note 59663 added to language.basic-syntax
| From: | (http://mike.eire.ca/) | Date: | Mon, 12 Dec 2005 23:17:30 +0000 |
| Subject: | note 59663 added to language.basic-syntax | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100034@lists.php.net to get a copy of this message | ||
The XML declaration does not need to be handled specially.
You should output it via an echo statement, in case your code is ever used on a server that is
(poorly) configured to use short open tags.
But there's no need to treat the ?> at the end of the string specially. That's because
it's in a string. The only thing PHP ever looks for in a string is \ or $ (the latter only in
double-quoted strings.)
I have never had need for the following, as some have suggested below:
<?php
$xml=rawurldecode('%3C%3Fxml%20version%3D%221.0%22%3F%3E');
echo($xml);
?>
<?php echo '<?xml version="1.0" ?'.'>' ?>
<?php echo "<?xml version=\"1.0\"\x3F>" ?>
----
Manual Page -- http://www.php.net/manual/en/language.basic-syntax.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59663
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59663&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59663&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59663&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59663&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59663&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59663&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59663&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59663&report=yes
Search -- http://master.php.net/manage/user-notes.php