Twitter의 API를 배우려고합니다. 이것은 요청을 보낼 때 서버가 반환하는 것입니다.PHP의 다차원 배열에서 중첩 된 값은 어떻게됩니까?
echo($tweets[$tweet_counter]['created_at']);
가 어떻게 URL을 액세스합니까 : 비 중첩 된 값에 대해 작동 내가 사용하고있는 코드는 다음과 같은 경우
[
{
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Wed Aug 29 17:12:58 +0000 2012",
"id_str": "240859602684612608",
"entities": {
"urls": [
{
"expanded_url": "https://dev.twitter.com/blog/twitter-certified-products",
"url": "https://t.co/MjJ8xAnT",
"indices": [
52,
73
],
"display_url": "dev.twitter.com/blog/twitter-c\u2026"
}
],
"hashtags": [
],
ad infinitum...
내 질문은?
echo($tweets[$tweet_counter]['entities']['urls']['url']);
당신은 대괄호로 변수를 넣어 필요가 없습니다 형식 ('[...]') echo''사용하는 경우, 단지를 'echo $ tweets [$ tweet_counter .....' – Pudge601
나는 그것을 편집했다. 나는 읽을 수 있도록 괄호를 사용했다. –