2013-04-08 26 views
-6
stdClass Object 
(
    [entities] => stdClass Object 
     (
      [urls] => Array 
       (
        [0] => stdClass Object 
         (
          [url] => asdl;kfas.com 
          [expanded_url] => http://HOWDOIPRINTTHISURL.com 
          [display_url] => asdlkfsldfj.com 
         ) 

       ) 

     ) 

) 

當我爲我的變量$ fullurl執行print_r時,我得到上面的代碼。我將如何打印說'http://HOWDOIPRINTTHISURL.com'的部分?謝謝我如何在PHP中打印此文件

+0

'echo $ object-> entities-> urls [0] - > expanded_url' – Baba 2013-04-08 21:01:40

+0

它寫在文檔和非常基本。你嘗試過搜索嗎? – 2013-04-08 21:01:55

+0

@Baba您沒有類,但存儲在變量中的對象/實例。 -0.1不良變量選擇;) – bwoebi 2013-04-08 21:03:00

回答

2
print $fullurl->entities->urls[0]->expanded_url;