Re: Outputting text "<?" how to?

From: Date: Thu, 30 Mar 2006 20:39:02 +0000
Subject: Re: Outputting text "<?" how to?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-232945@lists.php.net to get a copy of this message
tedd wrote:
Merlin: First the syntax should be: <?xml version="1.0" encoding="ISO-8859-1" ?/> <-- note the close /
No, that is invalid XML. The specification is available at http://www.w3.org/TR/XML11 (and makes riveting reading! ;) [snip]
If you want to print it to a web page, try: <?php $a=<<<EOD &lt;?xml version="1.0" encoding="ISO-8859-1" ?/> EOD; echo($a);
echo '&lt;?xml version="1.0" encoding="ISO-8859-1" ?>'; would work just as well and is a hell of a lot easier to look at. That's assuming you actually want it to appear on the page for the user to see, if you want the browser to interpret it you'll have to change the &lt; at the start to a < -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM jasper@album.co.nz 021 708 334

« previous php.general (#232945) next »