I was working on something else tonight when I literally stumbled across another solution that works here... pick your poison:

<?php
$heredoc = <<<XML
<?xml version="1.0" encoding="iso-8859-1" ?>
<root>
  <node attribute="I am an attribute">
    <text>I am a text node.</text>
  </node>
  <dynamic>
    <string1>%1\$s</string1>
    <string1>%1\$s</string1>
    <string2>%2\$s</string2>
    <integer>%3\$d</integer>
  </dynamic>
</root>
XML;

echo '<pre>';
define ('string1', 'Well looky here, some text.');
define ('string2', 'Man, I wish I could be a knight who said nee!');
define ('integer', 123452345.23232);

$xml = sprintf($heredoc, string1, string2, integer);

print_r(htmlentities($xml));

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to