Charas-Project
Off-Topic => Really Old Stuff => Archive => PHP => Topic started by: Seth Mitchell on March 27, 2006, 02:04:52 AM
-
What are some common PHP codes.
I just need some basic ones for my new site.
-
Well, PHP is not like HTML - there are no "codes" persay, it's a programming language that works into websites. Even so, the most simply command in PHP is
print ("Stuff that is displayed on the webpage.");
Simple math operations work too.
$a = 2 + 7
The $a declares a variable named $a. If you decide to put something like
print ($a);
It will print "9". It works in the math part too.
Those are the simple basics. If you're interested in more, just ask and I'll tell you about conditionals.
-
PHP an HTML is interchangable by the way:
echo date("l j F Y H:i.s");?>
//This is a comment, and won't be displayed
for($i = 0; $i < 10; $i++)
{
echo $i;
}
?>
Also, follow the PHP lessons to know more about PHP.