вывод данных по ключу из массива

Discussion in 'PHP' started by justonline, 28 May 2012.

  1. justonline

    justonline network ninja

    Joined:
    27 Jul 2011
    Messages:
    532
    Likes Received:
    61
    Reputations:
    53
    PHP:
    stdClass Object
    (
        [
    response] => Array
            (
                [
    0] => 6770
                
    [1] => stdClass Object
                    
    (
                        [
    id] => 35600
                        
    [from_id] => -27760574
                        
    [to_id] => -27760574
                        
    [date] => 1338217584
                        
    [text] => РќРµ Р¶Р°Р»РµР№ Рѕ СЃРІРѕРёС… РѕС€РёР±РєР°С…ведь РЅРµ СЃРґРµР»Р°РІ РёС…ты РЅРёРєРѕРіРґР° РЅРµ СѓР·РЅР°РµС€СЊ РєР°Рє РґРµР»Р°С‚СЊ РїСЂР°РІРёР»СЊРЅРѕ
                        
    [media] => stdClass Object
                            
    (
                                [
    type] => photo
                                
    [owner_id] => -27760574
                                
    [item_id] => 283301590
                                
    [thumb_src] => http://cs317130.userapi.com/v317130671/1ee7/lGxxyzwEN_w.jpg
                            
    )

                        [
    attachment] => stdClass Object
                            
    (
                                [
    type] => photo
                                
    [photo] => stdClass Object
                                    
    (
                                        [
    pid] => 283301590
                                        
    [aid] => -7
                                        
    [owner_id] => -27760574
                                        
    [user_id] => 19634671
                                        
    [src] => http://cs317130.userapi.com/v317130671/1ee7/lGxxyzwEN_w.jpg
                                        
    [src_big] => http://cs317130.userapi.com/v317130671/1ee8/kD_x4nrRnI8.jpg
                                        
    [src_small] => http://cs317130.userapi.com/v317130671/1ee6/V03GLjf06v0.jpg
                                        
    [width] => 500
                                        
    [height] => 333
                                        
    [text] => 
                                        [
    created] => 1338217584
                                        
    [access_key] => ba6c3b51fae90adb82
                                    
    )

                            )
    получаю такой массив.
    надо записать в файл только [text].
     
  2. justonline

    justonline network ninja

    Joined:
    27 Jul 2011
    Messages:
    532
    Likes Received:
    61
    Reputations:
    53
    нашел решение :)
    $sss->response[1]->text;
    и прогон через foreach :)
     
    #2 justonline, 28 May 2012
    Last edited: 28 May 2012
Loading...