[PHP] edit xml with php?

2001-07-17 Thread Jan Grafstrom

Hi!
I am trying to edit this xml-file:
I want to change one of the li-nodes.
?xml version=1.0?
kund
   li
  naper/na
  enBylund/en
  gaSemin/ga
   /li
   li
  naAxel/na
  enTiman/en
  gaSemina/ga
   /li
   li
  naLars/na
  enBerg/en
  gaSeminar/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]


RE: [PHP] edit xml with php?

2001-07-17 Thread Jens Wabnitz

 I am trying to edit this xml-file:

Have a look at: http://ww.phpxml.org/

Bye
Jens

-- 
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]