I l @ ve RuBoard |
PHP would not be very useful if all you could do was see what PHP features were installed. What you will use it to do most frequently is to send information to the browser in the form of plain text and HTML tags. For this, you will use the print() function. To print a simple message:
Tip There are different functions you can use to send text to the browser including echo() and printf(). Echo is virtually synonymous to print, so it will not be discussed in any more detail. I will cover printf() in Chapter 13, Creating Web Applications. Tip You can use print() with or without the parentheses but you must always use the quotation marks, e.g., you could have typed print "Hello, world!"; While we'll use parentheses in this book to further separate out printed statements, most programmers do not use them. My suggestion is to find a style that you like and stick to it. Tip Failure to use an opening or closing quotation mark or parenthesis or neglecting to include the required trailing semicolon for every statement are common causes of errors when using the print() statement. If your script is not executing properly, check these items first. |
I l @ ve RuBoard |