[PHP] Outputting text ? how to?
Hi there, I would like to output following text with php: ?xml version=1.0 encoding=ISO-8859-1 ? How can I do that? I tried to escape the ? with \? but this did not help. Any ideas? Thank you for any hint, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Outputting text ? how to?
Merlin a écrit : Hi there, I would like to output following text with php: ?xml version=1.0 encoding=ISO-8859-1 ? How can I do that? I tried to escape the ? with \? but this did not help. htmlentities perhaps ? N F Any ideas? Thank you for any hint, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Outputting text ? how to?
Merlin wrote: Hi there, I would like to output following text with php: ?xml version=1.0 encoding=ISO-8859-1 ? How can I do that? I tried to escape the ? with \? but this did not help. Either: 1. Turn off short tags (good idea if you plan on distributing your code). 2. Just echo or print that text. Like: ?php echo '?xml version=1.0 encoding=ISO-8859-1?' . \n; ? -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM [EMAIL PROTECTED] 021 708 334 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Outputting text ? how to?
Look up htmlentities() in the php manual and see if it'll work for you. Hugh - Original Message - From: Merlin [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, March 30, 2006 1:28 AM Subject: [PHP] Outputting text ? how to? Hi there, I would like to output following text with php: ?xml version=1.0 encoding=ISO-8859-1 ? How can I do that? I tried to escape the ? with \? but this did not help. Any ideas? Thank you for any hint, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.3/295 - Release Date: 3/28/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.3/295 - Release Date: 3/28/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Outputting text ? how to?
At 11:28 AM +0200 3/30/06, Merlin wrote: Hi there, I would like to output following text with php: ?xml version=1.0 encoding=ISO-8859-1 ? How can I do that? I tried to escape the ? with \? but this did not help. Any ideas? Thank you for any hint, Merlin Merlin: First the syntax should be: ?xml version=1.0 encoding=ISO-8859-1 ?/ -- note the close / Second, to what do you want to output the text? If you want to write it to a text file, try: $filename = text.txt; $file = fopen( $filename, w ); fwrite( $file, '?xml version=1.0 encoding=ISO-8859-1 ?/'); fclose( $file ); 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); HTH's tedd PS: I would also consider changing the encoding to utf-8 -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Outputting text ? how to?
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 [EMAIL PROTECTED] 021 708 334 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php