Menu
IDS40 - php script
PHP
Similar to JavaScript, php is a language that can be inserted inside of an HTML document.
w3Schools has tools for you to learn php on your own.
w3Schools has tools for you to learn php on your own.
The example shown inserts a php tag inside of the HTML doc. The command “echo” just inserts the text into an HTML document. Why would you not just type it in without the php tag? In this case, that would be easier, but php allows you to program control based on mathematical calculations. For instance, you could potentially do something like:
IF bankBalance = 0 THEN echo “you are broke” IF bankBalance > 1000 THEN echo “you have lots of money” |
Excercise
Try out the introductory PHP excercise and display your own name.