PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Any help with this? It should be fairly basic but I have no idea where to start. To be honest, I'm a bit of a PHP noob but once this is sorted my application wont need any more PHP.
Although that's a pretty dodgy way of doing it. It may be in your interests to just learn DOM.
Thanks very much! Unfortunately I can't seem to get it to work unless I'm missing something completely. I would learn "DOM" but this is the only time I'm ever going to use this or PHP in general really. Is there something that I could have missed out?
Ah sorry, I've been an idiot. Its not technically an "XML" its a plist which is a type of XML. This means at the top and a few times in the document it has:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
It doesn't understand that code when it checks it which is why it doesn't work. Sorry my mistake, is there any way around this? So like to say check it unless text = that.
What's the exact file you're trying to parse? I'll have another go at it...but I need to know what I'm trying to find in order to find it.
But it should still work anyway...all that code does is loop through each line, and delete the line if it includes <string>George</string>. So any line containing that should be removed.