views:

29

answers:

1

Howdy again Stack Overflowers,

I have this feed that I want to store the session_id in that xml file as a string to play with outside the loop, what am I doing wrong?

if($xmlobj = simplexml_load_string(file_get_contents($xml_feed)))
      {
            foreach($xmlobj as $listing)
      {
           echo $session_Id = $listing->sessionId;
      }

      if(isset($_SESSION['sessionId'])): 
            echo 'Your Session Id is' . $_SESSION['sessionId'] = $session_Id;
            else: 
                  echo 'Your Session Id is' . $_SESSION['sessionId'] = $session_Id;
            endif;
      }
+1  A: 

I Don't think you can have the : in php.

its on the else: and the end of the if:

corymathews
It's shorthand, yes you can.
Keith Donegan
ah will have to try it later. I was a bit unsure since its php and you can do basically whatever you want.
corymathews