2013-06-08 2 views
0

PHP에서 배열은 다음과 같습니다.배열에서 첫 번째 배열의 값을 얻으려면

Array ([0] => 
    [1] => Array ([id] => 9 [slot] => 2 [name] => Test Ad [alt] => Test Ad [dimension_width] => 300 [dimension_height] => 400 [clicks] => 1 [start_date] => 06/07/2013 [end_date] => 07/07/2013 [status] => 1 [target] => http://images.google.com [image_url] => http://localhost/WebSites/coffee/wp-content/uploads/2013/06/uwp5-1-151553.jpeg [pre_exp_email] => 0) 
    [2] => Array ([id] => 12 [slot] => 1 [name] => Test Ad [alt] => Test Ad [dimension_width] => 200 [dimension_height] => 300 [clicks] => 0 [start_date] => 06/08/2013 [end_date] => 07/08/2013 [status] => 1 [target] => http://facebook.com [image_url] => http://localhost/WebSites/coffee/wp-content/uploads/2013/06/uwp5-1-1515532.jpeg [pre_exp_email] => 0) 
    [3] => Array ([id] => 14 [slot] => 1 [name] => Test Ad [alt] => Test Ad [dimension_width] => 200 [dimension_height] => 300 [clicks] => 0 [start_date] => 06/08/2013 [end_date] => 07/08/2013 [status] => 1 [target] => http://facebook.com [image_url] => http://localhost/WebSites/coffee/wp-content/uploads/2013/06/uwp5-1-1515532.jpeg [pre_exp_email] => 0) 
    ) 

여기에서 나는 array의 첫 번째 값을 얻고 싶습니다. 예를 들어 나는

[1] => Array ([id] => 9 [slot] => 2 [name] => Test Ad [alt] => Test Ad [dimension_width] => 300 [dimension_height] => 400 [clicks] => 1 [start_date] => 06/07/2013 [end_date] => 07/07/2013 [status] => 1 [target] => http://images.google.com [image_url] => http://localhost/WebSites/coffee/wp-content/uploads/2013/06/uwp5-1-151553.jpeg [pre_exp_email] => 0) 

그래서 누군가가 친절하게 방법 1 배열의 값을 얻는 방법? 어떤 도움과 제안이 정말로 감지 될 것입니다 말해 줄 수 첫 번째 배열의 값을 얻을 싶어요. 감사합니다

답변

1

모든 배열 한 다음, 변수 $의에서 myArray에 있었다라고

에서 myArray [1]

는 당신에게 당신의 첫 번째 배열

을 줄 것이다
관련 문제