title: In PHP how do you get the simple text of an XML attribute only XML?
body: <p>I have an XML that's coming back from an cURL post that's returning:</p>
  
  <pre><code>$output=&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;mtMessageRsp carrier="102" messageId="769f2e4f-56da-4865-988a-a9199c387a48"/&gt;
  </code></pre>
  
  <p>I'm returning this as an XML via:</p>
  
  <pre><code>return simplexml_load_string($output);
  </code></pre>
  
  <p>$result is catching the return and it's coming back as:</p>
  
  <pre><code>$result = { 
    "@attributes" :  { 
      carrier : "102",
      messageId : "8d691cbe-d188-42b1-9041-387666d39c6a"
    }
  </code></pre>
  
  <p>How can I drill down to get the messageId as plane text?  When I use this:</p>
  
  <pre><code>$result['messageId']
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>{ 
    "0" : "bf629ae9-c86a-486a-bfb0-704e16448ddf"
  }
  </code></pre>
  
  <p>But I just want:</p>
  
  <pre><code>bf629ae9-c86a-486a-bfb0-704e16448ddf
  </code></pre>