Jump to content

redgenieuk

New Members
  • Posts

    2
  • Joined

  • Last visited

redgenieuk's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. Stupidity has been found. I am answering my own question as I cannot see how to remove it; but hopefully it might help someone else one day! Answer is: foreach ($txtnode1->parentNode as $child) should be foreach ($txtnode1->parentNode->childNodes as $child)
  2. Morning! I have started using DOMdocument for a job but hit an issue with this code snippet. if ($txtnode1->parentNode->hasChildNodes()) { Echo "***Has Children Start***<br>"; foreach ($txt1->parentNode as $child) { Echo "NodeChild<br>"; } Echo "***Has Children End***<br>"; } I get the output: ***Has Children Start*** ***Has Children End*** So ($txtnode1->parentNode->hasChildNodes()) is true; But foreach ($txtnode1->parentNode as $child) Isn't looping.... I think indicating there are no children? But there must be a child.... because we are going to $txtnode1's parentNode... so in summary i am very confused! Any help greatly appreciated. TIA.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.