php_first_lesson
This is an old revision of the document!
Table of Contents
PHP First Lesson
This is suitable for people who are just learning programming. This page is a record of what Roger and I were able to accomplish in the first lesson. Charles was there too, but he was fated to drop out because he could not type very fast.
A big question could be, “Why PHP?” Well, PHP has an easy syntax and is extremely useful for web-based programming. It's a great starter, with better syntax than Python. And, why not? PHP has it's own local server, so it's easy for anyone to use. You can just use a text editor. Its oldschool! A great start for the serious. And so, we began.
1. Hello World
Run this. What does it do? What is ECHO?
<?php echo "Hello, world!\n"; ?>
ex.2 echo.php
Another example.
<?php echo "Hello, my name is Appledog!\n"; ?>
ex.3 roger.php
<?php echo "<---- he is Roger!\n"; echo "I am appledog! wheee!\n"; echo "He is Charles! ------>\n"; ?>
ex. 4 box.php
We can draw art. Can you make a triangle? (homework!)
<?php echo "*****\n"; echo "* *\n"; echo "* *\n"; echo "* *\n"; echo "*****\n"; ?>
php_first_lesson.1728025342.txt.gz · Last modified: 2024/10/04 07:02 by appledog