You are here: Re: serving xhtml with php « PHP Programming Language « IT news, forums, messages
Re: serving xhtml with php

Posted by Rik on 07/18/06 23:58

Chung Leong wrote:
> Chung Leong wrote:
>> abracad_1999@yahoo.com wrote:
>>> If I try to echo this in PHP:
>>> <?php
>>> echo '<?xml version="1.0" encoding="iso-8859-1"?>';
>>> The closing ?> of the xhtml bit is interpreted as closing the php.
>>> Thus:
>>> '; ?>
>>> is displayed in the browser.
>>> Any way around this?
>>
>> echo '<?xml ... ?' . '>';
>
> Wait a minute. That's not supposed to be necessary. PHP knows when
> it's inside a string.


You are right.
<?php
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
?>
Works perfectly here (tested with shorttags on which are usually off).

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация