Kijk hier eens naar:
http://forum.sa-mp.com/showthread.php?t=301435
toevoeging op 28 juli 2013, 21:55:33:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
stdClass Object
(
[responseData] => stdClass Object
(
[results] => Array
(
[0] => stdClass Object
(
[GsearchResultClass] => GimageSearch
[width] => 340
[height] => 340
[imageId] => ANd9GcQND9tmqoKoaV_x5R9Fnt9ZEppd--Sg_JgKGIXtcj8w2r2E4sHitN97UhI
[tbWidth] => 119
[tbHeight] => 119
[unescapedUrl] => http://upload.wikimedia.org/wikipedia/en/4/43/Tweet-southern-hummingbird.jpg
[url] => http://upload.wikimedia.org/wikipedia/en/4/43/Tweet-southern-hummingbird.jpg
[visibleUrl] => en.wikipedia.org
[title] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[titleNoFormatting] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[originalContextUrl] => http://en.wikipedia.org/wiki/File:Tweet-southern-hummingbird.jpg
[content] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[contentNoFormatting] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[tbUrl] => http://t2.gstatic.com/images?q=tbn:ANd9GcQND9tmqoKoaV_x5R9Fnt9ZEppd--Sg_JgKGIXtcj8w2r2E4sHitN97UhI
)
Deze array bestaat natuurlijk nog uit andere elementen.
Nu wil ik dus eigenlijk dit; echo $array[0][unescapedurl];
Maar zo werkt het niet. Kan iemand mij vertellen hoe ik dit doe?
Dit probeerde ik ook: echo $json[responseData][results][0][unescapedUrl];
Dit is een Object, geen Array.
Ik heb je (nadat je mij om hulp had gepmed) een oplossing via PM gestuurd.
http://forum.sa-mp.com/showthread.php?t=301435
toevoeging op 28 juli 2013, 21:55:33:
Sanderc schreef:Codeblok (voorbeeld.php):Dit is een array; met naam: $array
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
stdClass Object
(
[responseData] => stdClass Object
(
[results] => Array
(
[0] => stdClass Object
(
[GsearchResultClass] => GimageSearch
[width] => 340
[height] => 340
[imageId] => ANd9GcQND9tmqoKoaV_x5R9Fnt9ZEppd--Sg_JgKGIXtcj8w2r2E4sHitN97UhI
[tbWidth] => 119
[tbHeight] => 119
[unescapedUrl] => http://upload.wikimedia.org/wikipedia/en/4/43/Tweet-southern-hummingbird.jpg
[url] => http://upload.wikimedia.org/wikipedia/en/4/43/Tweet-southern-hummingbird.jpg
[visibleUrl] => en.wikipedia.org
[title] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[titleNoFormatting] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[originalContextUrl] => http://en.wikipedia.org/wiki/File:Tweet-southern-hummingbird.jpg
[content] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[contentNoFormatting] => File:Tweet-southern-hummingbird.jpg - Wikipedia, the free encyclopedia
[tbUrl] => http://t2.gstatic.com/images?q=tbn:ANd9GcQND9tmqoKoaV_x5R9Fnt9ZEppd--Sg_JgKGIXtcj8w2r2E4sHitN97UhI
)
Deze array bestaat natuurlijk nog uit andere elementen.
Nu wil ik dus eigenlijk dit; echo $array[0][unescapedurl];
Maar zo werkt het niet. Kan iemand mij vertellen hoe ik dit doe?
Dit probeerde ik ook: echo $json[responseData][results][0][unescapedUrl];
Dit is een Object, geen Array.
Ik heb je (nadat je mij om hulp had gepmed) een oplossing via PM gestuurd.

