Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]json_encode na home.pl nie chce działać...
northwest
post
Post #1





Grupa: Zarejestrowani
Postów: 788
Pomógł: 1
Dołączył: 17.09.2004

Ostrzeżenie: (10%)
X----


Witam serdecznie,
Mam taki kod:
  1. echo json_encode([
  2. 'initialPreview' => [
  3. "<img src='../../userfiles/".$plik3."' class='file-preview-image'>",
  4. ],
  5. 'initialPreviewConfig' => [
  6. ['caption' => "$plik3", 'width' => '120px', 'url' => "deletefile.php?id=$lp&file=mini_$plik3", 'key' => $key],
  7. ],
  8. 'append' => true // whether to append these configurations to initialPreview.
  9. // if set to false it will overwrite initial preview
  10. // if set to true it will append to initial preview
  11. // if this propery not set or passed, it will default to true.
  12. ]);


Na localhoście działa mi poprawnie, jednak na home.pl nie chce działać (IMG:style_emoticons/default/sad.gif)

Wyskakuje błąd:
  1. <br />
  2. <b>Parse error</b>: syntax error, unexpected '[', expecting ')' in <b>/cms/admin/upload.php</b> on line
  3. <b>32</b><br />


W momencie gdy usunę te nawiasy to wyskakuje błąd:
  1. <br />
  2. <b>Parse error</b>: syntax error, unexpected T_DOUBLE_ARROW in <b>/cms/admin/upload.php</b> on line
  3. <b>33</b><br />



Wie ktoś może jak to naprawić?

Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 24.12.2025 - 23:31