note 39656 deleted from language.basic-syntax by danbrown
| From: | danbrown@php.net | Date: | Thu, 17 Jan 2013 15:42:47 +0000 |
| Subject: | note 39656 deleted from language.basic-syntax by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193175@lists.php.net to get a copy of this message | ||
Note Submitter: TarquinWJ
----
Not spotted any messages like this one - delete it if there was one.
My hosting service allows <? and ?>, but I like to use valid XHTML, so I came up with this
simple solution:
It is possible to use the short tags <? ?> with XHTML or XML documents. The only problem is
that X(HT)ML requires a declaration using <? and ?>
<?xml version="1.0" encoding="UTF-8"?>
To avoid the problem, simply replace <? with <<? ?>?
and ?> with ?<? ?>>
<<? ?>?xml version="1.0" encoding="UTF-8"?<? ?>>
This inserts a blank piece of PHP in between the < and ?, and when parsed will output the regular
tag
<?xml version="1.0" encoding="UTF-8"?>