note 35661 added to function.print

From: Date: Wed, 10 Sep 2003 07:33:44 +0000
Subject: note 35661 added to function.print
Groups: php.notes 
Request: Send a blank email to php-notes+get-55918@lists.php.net to get a copy of this message
There must be a difference between a PHP print output and a simple flat HTML or XML source file For example, if the following XML stuff is placed in a .XML file (with the correct stylesheet it the right place), it displays correctly with IE or Netscape: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="stylesheets/form_style_sheet.xsl"?> <form> <one_link> <href>file.php</href> <caption>some caption</caption> <one_link> </form> Now if I just edit the file to have: <?php print "<?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="stylesheets/form_style_sheet.xsl"?> <form> <one_link> <href>file.php</href> <caption>some caption</caption> <one_link> </form> "; ?> Some browser refuse it (for example, Netscape just show me the contain of the tags, ignoring the stylesheet) The very weird thing is that when viewing the source in the browser in both cases and with IE 6 or Netscape 7, I got excatly the same output. Just that Netscape seems to behave differently when receiving the same data from a flat file or from PHP. Anyone knows how to control the "format" of what print (or echo, this one does not work either) outputs? ---- Manual Page -- http://www.php.net/manual/en/function.print.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35661 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35661&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35661&report=yes

« previous php.notes (#55918) next »