Hi!
I am trying to edit this xml-file:
I want to change one of the li-nodes.
<?xml version="1.0"?>
<kund>
   <li>
      <na>per</na>
      <en>Bylund</en>
      <ga>Semin</ga>
   </li>
   <li>
      <na>Axel</na>
      <en>Timan</en>
      <ga>Semina</ga>
   </li>
   <li>
      <na>Lars</na>
      <en>Berg</en>
      <ga>Seminar</ga>
   </li>
</kund>
-------------
I have tryed to read and explode on "</li>"
$fd = fopen($filename, "r");
$string = fread($fd, filesize($filename));
$fru = explode ("</li>", $string);
for ($i=0;$fru[$i];++$i) {
$newfru = ("$fru[$i]"."</li>");
$newfru = str_replace("</kund>"."\r\n"."</li>","</kund>",$newfru);
print $newfru;
}
How to replace one of the $fru[i], I have tryed inside the forloop but
than it replaces all.

Thanks in advance for any help.
Regards
Jan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to