Change Value of Current Child - SimpleXML PHP
问题 The setup is quite simple. How do you use the children() iterating function of SimpleXML and then modify the value of the current node? Here's a scenario below: <Ad> <Unit>Value</Unit> <Size>Value</Size> <Time>Value</Time> </Ad> I'm trying to use children() and then to assign to the current Child to change "Value" in all of the above nodes. foreach ($parent->children() as $child){ $child= "New Value"; // Proper way to access $child's value without overwriting the entire object??? } Thanks in