Simple things of PHP can be just as fun as the advanced things in PHP!
To prove that I wanted to make a small quiz, and here it is.
Below you'll see 10 pieces of PHP5 code, the goal is to figure out the code and know the output before you actually run it.
Have fun!
Comment and closing tag
<?php // Without cheating.. What will you see when you run this single line of ?\?> php code
Echo print and get what
<?php
// What do you expect from this ?
echo print( 1 ); ?>
What wil eval to true
<?php
// How many times will we get 'true' ?
$boolean = false;
echo ($boolean) ? 'true' : 'false';
$boolean = '0';
echo ($boolean) ? 'true' : 'false';
$boolean = '00';
echo ($boolean) ? 'true' : 'false';
Continue reading "PHP Quiz part 1"