Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> json_encode - JSON_UNESCAPED_UNICODE
sebekzosw
post
Post #1





Grupa: Zarejestrowani
Postów: 437
Pomógł: 42
Dołączył: 16.04.2007

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


Witam,

otrzymuje komunikat - PHP Notice: Use of undefined constant JSON_UNESCAPED_UNICODE - wynika on z tego, że serwer ma PHP 5.3

jak można obejść to, że wszystko będzie działało dalej jak na 5.4, bez większego przerabiania json_encode?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
com
post
Post #2





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

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


  1. function encode_items($array)
  2. {
  3. foreach($array as $key => $value)
  4. {
  5. if(is_array($value))
  6. {
  7. $array[$key] = encode_items($value);
  8. }
  9. else
  10. {
  11. $array[$key] = mb_convert_encoding($value, 'Windows-1252', 'UTF-8');
  12. }
  13. }
  14.  
  15. return $array;
  16. }
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: 9.10.2025 - 07:02