PHP Problem

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
Could someone please help me fix the script. Long story short, I need to put entries in between certain characters in a file. I have this XML file:
HTML:
<?xml version="1.0" encoding="ISO-8859-1"?><LOG>
</LOG>
and I need to put text between the LOG tags. I have tried:
PHP:
$replace = $text."</LOG>";
$text = str_ireplace("</LOG>",$replace,$content[0]);
//and I have tried:
$array = explode("</LOG>",$content[0]);
$array[0] = $array[0].$text;
$text = implode("</LOG",$array);
$content[0] being the original file and $text being the changed file. Im a newbie at PHP and all it function so could someone please show me how to do this simple script.:dunno:
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
well, first off, you should probably be using a xml 2.0 version. Other than that, try running it through a feed validator. Search google. or use w3schools.com for xml help
 
Top