0

How can I get "bla" in the below dump of my node Essentially bla is what is contained in my node

<mynode name="myvalueone" display="myvalue2">bla</mynode>


object(SimpleXMLElement)[21]
  public '@attributes' => 
    array
      'name' => string 'myvalueone' (length=65)
      'display' => string 'myvalue2' (length=9)
  string 'bla' (length=3)

1 Answer 1

1

You can obtain the value by casting the SimpleXMLElement to a string like this: $value = (string)$element;

Sign up to request clarification or add additional context in comments.

1 Comment

ah thank you! I had tried this but when I was doing a var_dump on the result it was giving me an SimpleXML Object but now I tried again and I see can cast that to a string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.