note 29243 added to faq
| From: | dwayne82 at hotmail dot com | Date: | Fri, 07 Feb 2003 07:14:06 +0000 |
| Subject: | note 29243 added to faq | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43544@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.
--
http://www.php.net/manual/en/faq.php
http://master.php.net/manage/user-notes.php?action=edit+29243
http://master.php.net/manage/user-notes.php?action=delete+29243
http://master.php.net/manage/user-notes.php?action=reject+29243