2014-06-24 6 views
-2
array 
    0 => 
    object(stdClass)[284] 
     public 'option_id' => string '243' (length=3) 
     public 'option_name' => string 'upme_profile_fields' (length=19) 
     public 'option_value' => string 'a:17:{i:50;a:7:{s:8:"position";s:2:"50";s:4:"type";s:9:"separator";s:4:"meta";s:22:"profile_info_separator";s:4:"name";s:12:"Profile Info";s:7:"private";i:0;s:7:"deleted";i:0;s:17:"show_to_user_role";i:0;}i:60;a:14:{s:8:"position";s:2:"60";s:4:"icon";s:6:"camera";s:5:"field";s:10:"fileupload";s:4:"type";s:8:"usermeta";s:4:"meta";s:8:"user_pic";s:4:"name";s:15:"Profile Picture";s:8:"can_hide";i:0;s:8:"can_edit";i:1;s:7:"private";i:0;s:6:"social";i:0;s:7:"deleted";i:0;s:17:"show_to_user_role";i:0;s:17:"edit_b'... (length=5301) 
     public 'autoload' => string 'yes' (length=3) 

위의 출력에서 ​​'option_value'필드를 가져 오는 방법은 무엇입니까?특정 필드 가져 오기

답변

1

나는 당신의 변수 이름이 무엇인지 잘 모릅니다하지만 당신이 뭔가를 할 수 있습니다 :

$option_value = $array[0]->option_value; 

을 그 목적 때문에 내부의 -> (화살표 연산자)를 사용하여 원하는 속성을 가리 킵니다.