note 29243 deleted from faq by tix
| From: | tix@php.net | Date: | Fri, 07 Feb 2003 12:55:23 +0000 |
| Subject: | note 29243 deleted from faq by tix | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43553@lists.php.net to get a copy of this message | ||
This may seem trivial or common knowledge, but it was something that I learned the hard way as a new
PHP user.
When entering PHP code into an HTML document, the proper syntax is:
<?php
. . . some php code . . .
?>
The following will cause an "Unexpected T_FUNCTION" error when you load the HTML document
into a browser:
<? php
. . . some php code . . .
?>
IE: "<?php" must be entered WITHOUT SPACES!
After spending more than 6 hours of checking every ;, checking syntax of every function and function
call, as well as making sure all of the proper "require" and "include" were in
place, I finally noticed that single space. I removed the space, and wallah! . . . the
"Unexpected T_FUNCTION" error dissapeared and everthing worked dandy.