This site is an assignment site for study group of
Hello World forum.
Together we are studying the book Larry Ullman PHP For World Wide Web.
Chapter 1: Getting Started With PHP
- Basic XHTML Syntax
- Basic PHP Syntax
- Testing Your Script
- Sending Text to the Browser
- Sending HTML to the Browser
- Using White Space in PHP and HTML
- Adding Comments to Your Scripts
Working with XAMMP in Mac OS X 10.5 (Leopard)
My coal is to test PHP sites on my own computer before sending them to remote server. My remote server is going to be my son's server and it's using PHP 5. Setting up my local and testing server was first a bit complicated.
I first tried MAMP, which was easy to install, but somehow difficult to use and modify the settings. Then I found a good instructions how you do that in Mac OS X 10.5 (Leopard) ( Apache and PHP comes with Leopard).
That works fine, but saw KC using XAMMP and wanted to try it. So I installed XAMMP and started it just clicking XAMPP Control Panel.app's icon, without using terminal (even the instructions in XAMMP's site pointed to use terminal) and everything is working just fine now. Yes and I got also Dreamweaver settings working right.
To use echo or print Hmmm...
In these next two sentence the first one is created using PHP command print
and the next echo
<?php print ("Hello world!");?>
Hello, world!
<?php echo "Hello world!";?>
Hello, world!Both do the same job, so it usually comes down to a matter of personal choise on which one you like to use.
Echo does not give you a return value. print() does. echo accepts several arguments. print() one.
Hello, world! This is print statement
Hello, world! This is echo statement
Echo is faster than print. There is a lot of discussion about
echo vs. print. Read More.
I think I choose echo. I have used to use it and it's shoter to type , hmm ... I choose echo.
Commenting code
This is HTML comment <--comment-->
<?php
//This is a single line comment
#Or you may mark it like this
/*This is multiline comment.
It needs also
ending mark*/
?>