note 95554 deleted from domdocument.createprocessinginstruction by danbrown
| From: | danbrown@php.net | Date: | Fri, 08 Jan 2010 17:51:59 +0000 |
| Subject: | note 95554 deleted from domdocument.createprocessinginstruction by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164793@lists.php.net to get a copy of this message | ||
Note Submitter: miaseye at gmail dot com
----
Hello,
Referring to below comment, I think it would be possible to use this method in order to add, for
example, some PHP code in your XHTML document with the DOM. Note that PHP code is processing
instruction from the XHTML document point of view. What's your opinion ?
<?php
// Create document.
$xhtml = new DOMDocument( "1.0", "ISO-8859-15" );
// Create php code processing instruction line
$php = $xhtml->createProcessingInstruction('php', '
// some php code
');
// Append to document
$xhtml->appendChild($php);
?>