Help Please!

Status
Not open for further replies.

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
PHP is fairly new to me and I don't know all the functions it has. Could someone tell me how to add text between certain phrases inside a file? How do you search a file for a phrase? I need to add entries to a log in an xml file between tags and I can't figure out how to do it. Can someone help me? :biggrin:
 
Last edited:

mitamata

New Member
Messages
81
Reaction score
0
Points
0
If you're working with an xml, check this page:
http://si.php.net/manual/en/ref.xml.php

You'll find plenty of info on how to work with xmls in php there :)


Or you could just treat it as a regular file and use some of the functions found here:
http://si.php.net/manual/en/ref.filesystem.php
For example: you can read the xml file into a string, then do what you need to do to the string and then save the changed string back into a file.
 
Status
Not open for further replies.
Top