Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> json_encode($tablica) XmlHttpRequest w firebug zwraca mi zwykły html
uczeń php
post
Post #1





Grupa: Zarejestrowani
Postów: 159
Pomógł: 0
Dołączył: 8.01.2010

Ostrzeżenie: (0%)
-----


Za pomocą skryptu php generuję taką oto tablicę:
Array
(
[0] => Array
(
[slotId] => 5
[ruleId] => 42
[slogan] => Ta oferta
[refererType] => 0
[items] => Array
(
[0] => Array
(
[itemId] => 456677
[photoLink] => http://localhost/zdjecia/456677
)

[1] => Array
(
[itemId] => eegfr453
[photoLink] => http://localhost/zdjecia/eegfr453
)

[2] => Array
(
[itemId] => 168064
[photoLink] => http://localhost/zdjecia/05102008591
)

[3] => Array
(
[itemId] => 22092008536
[photoLink] => http://localhost/zdjecia/22092008536
)

[4] => Array
(
[itemId] => 18092008512
[photoLink] => http://localhost/zdjecia/18092008512
)

[5] => Array
(
[itemId] => 168064
[photoLink] => http://localhost/zdjecia/05102008590
)

[6] => Array
(
[itemId] => 22092008535
[photoLink] => http://localhost/zdjecia/22092008535
)

[7] => Array
(
[itemId] => 168064
[photoLink] => http://localhost/zdjecia/05102008589
)

[8] => Array
(
[itemId] => 777
[photoLink] => http://localhost/zdjecia/777
)

[9] => Array
(
[itemId] => 22092008538
[photoLink] => http://localhost/zdjecia/22092008538
)

)

)

)

następnie chciałbym to przekonwertować do json za pomocą funkcji json_encode($tablica), ale XmlHttpRequest w firebug zwraca mi zwykły html.
Go to the top of the page
+Quote Post
szok
post
Post #2





Grupa: Zarejestrowani
Postów: 165
Pomógł: 20
Dołączył: 2.03.2006

Ostrzeżenie: (0%)
-----


Zobacz to:
  1. header('Content-type: application/json');
  2. echo json_encode($tablica);


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 09:16