Posted by: spawnfestis on: March 24, 2009
Commented codesnippet for practicing PHP as a beginner.
Includes while-looping and variable declaring.
This helped me to understand PHP-syntax at it’s most basic level, but hey, got to start somewhere
<?php // PHP start tag.
// Declaration in PHP
$i = 0; // Just a variable, you don’t need to assign a data type in PHP!while($i < 5){ // Easy while loop, works like with C# or any other larger programming language
echo “Yahoo!
“; // Just like printf() or std::cout
$i++;
}?>; // End tag, stop the PHP script!