Sorry, i guess i didn't explain myself very well...
my XML file (simplified):
....
xmlns:lib="http://en.wikipedia.org/wiki/Manga"
....
<lib:manga title="Fullmetal">
<numVolumes>14</numVolumes>
</lib:manga>
....
by doing this:
$mangaLib = simplexml_load_file($mangaLibFile);
$mangaObj = $mangaLib->children($mangaURI);
$tmp = $mangaObj->xpath('//numVolumes[../@title="'.$title.'"]');
var_dump($tmp);
i get:
array(1) {
[0]=>
object(SimpleXMLElement)#18 (1) {
[0]=>
string(2) "14" // <numVolumes>14</numVolumes>
}
}
What i want to do is, change <numVolumes> from 14, to some other value!
So i would do this:
$mangaObj->manga[$INDEX]->numVolumes = 12345;
But to accomplish that, i need to know the value of $INDEX, am i correct or is there other way while using SimpleXML?
Because i simply can't do anything with $tmp!!! I can't access it, i don't know it's internal structure.
I simply can't do this: $tmp[0]->object[0] = 12345;
(this doesn't even make sense)
How can i change <numVolumes> value?
Thanks for your time. I appreciate it