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:
and I need to put text between the LOG tags. I have tried:
$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:
HTML:
<?xml version="1.0" encoding="ISO-8859-1"?><LOG>
</LOG>
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);