note 77367 deleted from function.json-encode by crell

From: Date: Fri, 01 Jul 2022 19:17:33 +0000
Subject: note 77367 deleted from function.json-encode by crell
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-218827@lists.php.net to get a copy of this message
Note Submitter: dennispopel(at)gmail.com ---- Obviously, this function has trouble encoding arrays with empty string keys (''). I have just noticed that (because I was using a function in PHP under PHP4). When I switched to PHP5's json_encode, I noticed that browsers could not correctly parse the encoded data. More investigation maybe needed for a bug report, but this quick note may save somebody several hours. Also, it manifests on Linux in 5.2.1 (tested on two boxes), on my XP with PHP5.2.3 json_encode() works just great! However, both 5.2.1 and 5.2.3 phpinfo()s show that the json version is 1.2.1 so might be Linux issue

« previous php.notes (#218827) next »