PHP5:
http://php.net/manual/en/ref.dom.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> I have an xml document storing some data I need. What I want to do is this:
> 1. Scan to the end of the file.
> 2. Find the closing tag.
> 3. Insert a new entry in before the closing tag.
There are specific classes and functions in the PHP core that can help
you do just this.
> I've tried:
> 1.
_data;
or a little more succinctly
$my_data = "foo bar";
$new_data = preg_replace('/(.*)(<\/.*>)$/i', '$1' . $my_data . '$2',
file_get_contents('./test.txt'));
echo $new_data;
Mark Cain
- Original Message -----
From: "Jared Sherman&
_data;
or a little more succinctly
$my_data = "foo bar";
$new_data = preg_replace('/(.*)(<\/.*>)$/i', '$1' . $my_data . '$2',
file_get_contents('./test.txt'));
echo $new_data;
Mark Cain
- Original Message -----
From: "Jared Sherman&
I have an xml document storing some data I need. What I want to do is this:
1. Scan to the end of the file.
2. Find the closing tag.
3. Insert a new entry in before the closing tag.
I've tried:
1. Creating new files and renaming them to be the original.
2. Writing the file to a dummy file and inse
5 matches
Mail list logo