note 56517 added to language.basic-syntax
| From: | PHX at osu1 dot php dot net | Date: | Tue, 06 Sep 2005 02:18:37 +0000 |
| Subject: | note 56517 added to language.basic-syntax | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94776@lists.php.net to get a copy of this message | ||
About the XML declaration, I prefer the methods which use echo, like the already provided:
<?php echo('<?xml version="1.0"
encoding="iso-8859-1"?'.'>'); ?>
and
<?php echo("<?xml version=\"1.0\"
encoding=\"iso-8859-1\"?>"); ?>
However, I am a newbie and test my documents in a Windows PC without PHP so the browser displays the
next characters, respectively:
'); ?>
and
"); ?>
In order to avoid them, I change the extension of my files from html to xhtml which solves the
problem in the first case and produces a XML parsing error in the second; but that error can be
avoided too using a space to divide the end tag of the XML declaration:
<?php echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?
>"); ?>
Of course I make the FTP program change the extension of the files from xhtml to php during
transfers.
----
Manual Page -- http://www.php.net/manual/en/language.basic-syntax.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56517
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56517&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56517&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56517&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56517&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56517&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56517&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56517&report=yes
Search -- http://master.php.net/manage/user-notes.php