0

I need your help guys, I have this issue: When I use the bigbluebutton api for retrieve the meetings from the server I received this result:

Array
( 
    [returncode] => SimpleXMLElement Object ( [0] => SUCCESS )
    [messageKey] => SimpleXMLElement Object ( )
    [message] => SimpleXMLElement Object ( ) 
    [0] => Array 
    ( 
     [meetingId] => SimpleXMLElement Object ( [0] => 1111)
     [meetingName] => SimpleXMLElement Object ( [0] => Test MeetingName ) 
     [createTime] => SimpleXMLElement Object ( [0] => 1402148945933 )
     [attendeePw] =>       SimpleXMLElement Object ( [0] => passw)
     [moderatorPw] => SimpleXMLElement Object ( [0] => passw) 
     [hasBeenForciblyEnded] => SimpleXMLElement Object ( [0] => false )
     [running] => SimpleXMLElement Object ( [0] => false ) 
     )
)

Where the second array will be populated by the meetings. Now there is one meeting so u see only one element. I don't need help with cycle for or foreach but I need your help for retrieve the meetingid or meetingname or attendepw.

i found this on stackoverflow :Get value from SimpleXMLElement Objectsimplexmlelement-object and the solution was: $value = (string) $xml->code[0]->lat;

But I think this is not the solution for me. I tried this code: $array=$result['message']; $id=$array['meetingId']; But now I can't retrieved the id from this $id. Sorry for my English, any help will be appreciated

Community
  • 1
  • 1

1 Answers1

1

To get the meetingId SimpleXMLElement Object

$meetingIdEl = $result[0]['meetingId'];

To get the value of meetingIdEl

$mettingId = $meetingIdEl->__toString(); // or (string)$meetingIdEl;
echo $meetingId; // 1111

SimpleXMLElement Documentation

robbmj
  • 16,085
  • 8
  • 38
  • 63