note 74584 added to function.utf8-encode
| From: | php-general at lists dot php dot net | Date: | Wed, 18 Apr 2007 16:06:11 +0000 |
| Subject: | note 74584 added to function.utf8-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125549@lists.php.net to get a copy of this message | ||
I just read what I wrote, sorry for the typos it was a long day:
here's the rewritten code:
xml_tpl.php
<?php
header("Content-Type: text/html;charset=ISO-8859-1");
print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
$names=array('jack','bob','vanessa','catherine','valerie');
?>
<parent>
<?php foreach($names as $name) {?>
<child name="<?php print $name?>" />
<?php } ?>
</parent>
<?php
function create_xml(){
ob_start();
include "xml_tpl.php";
$trapped_content=ob_get_contents();
ob_end_clean();
$file_path= "./somefile.xml";
$file_handle=fopen($file_path,'w');
fwrite($file_handle,utf8_encode($trapped_content));
}
?>
----
Server IP: 216.235.15.211
Probable Submitter: 69.70.24.116
----
Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php
Edit -- https://master.php.net/note/edit/74584
Del: integrated -- https://master.php.net/note/delete/74584/integrated
Del: useless -- https://master.php.net/note/delete/74584/useless
Del: bad code -- https://master.php.net/note/delete/74584/bad+code
Del: spam -- https://master.php.net/note/delete/74584/spam
Del: non-english -- https://master.php.net/note/delete/74584/non-english
Del: in docs -- https://master.php.net/note/delete/74584/in+docs
Del: other reasons-- https://master.php.net/note/delete/74584
Reject -- https://master.php.net/note/reject/74584
Search -- https://master.php.net/manage/user-notes.php