RE: [PHP] Problem with "<?xml ....>" inside the PHP code, due to "?"

From: Date: Fri, 02 Aug 2002 13:58:29 +0000
Subject: RE: [PHP] Problem with "<?xml ....>" inside the PHP code, due to "?"
Groups: php.general 
Request: Send a blank email to php-general+get-110833@lists.php.net to get a copy of this message
Turn off the short tag option in the PHP ini file, and always use '<?php' as your php start tag. When short tags are enabled, PHP sees the '<?' in '<?xml', and assumes it is a start tag. - Theo -----Original Message----- From: Scott Fletcher [mailto:scott@abcoa.com] Sent: Thursday, August 01, 2002 1:03 PM To: php-general@lists.php.net Subject: Re: [PHP] Problem with "<?xml ....>" inside the PHP code, due to "?" Thank you all for the feedback! I was trying to say the problem lie with the "?", not with the quote or double quote. Because PHP use "<?" also, so when php read this "<?xml", it think the "<?" is intended for PHP. So, using the escape character does the trick, "\" but now I get the invalid format as a response from the other side that read in the XML codes I send. Thanks, FletchSOD "Matt Babineau" <matt@criticalcode.com> wrote in message news:019701c23974$f29b78a0$0100a8c0@developerx... > <?php > $XML = "<\?xml version='1.0' > encoding='UTF-8'\?><Product>Apple</Product>"; > echo $XML; > ?> > > Try this? > > Matt Babineau > MCWD / CCFD > ----------------------------------------- > e: matt@criticalcode.com > p: 603.943.4237 > w: http://www.criticalcode.com > PO BOX 601 > Manchester, NH 03105 > > > -----Original Message----- > From: Scott Fletcher [mailto:scott@abcoa.com] > Sent: Thursday, August 01, 2002 12:03 PM > To: php-general@lists.php.net > Subject: [PHP] Problem with "<?xml ....>" inside the PHP code, due to > "?" > > > Anyone know the workaround with the situation here? Here is the sample > script. The problem is I include the XML tag into the PHP variable and > it messed up everything. It all had to do with "?" here since PHP use > it also. > > --clip-- > <?php > $XML = "<?xml version='1.0' > encoding='UTF-8'?><Product>Apple</Product>"; > echo $XML; > ?> > > Thanks, > FletchSOD > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#110833) next »