note 129510 added to function.json-decode

From: Date: Sat, 18 May 2024 12:32:54 +0000
Subject: note 129510 added to function.json-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-221331@lists.php.net to get a copy of this message
The output type of below code is string instead of Array, Object or null/false. $testString = '"{\"status\":\"failure\",\"message\":\"date must be in DD\/MM\/YYYY format\",\"statusCode\":400}"'; var_dump(json_decode($testString)); // outputs string type var_dump(json_last_error()); ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.13.131 (proxied: 103.68.221.92) ---- Manual Page -- https://php.net/manual/en/function.json-decode.php Edit -- https://main.php.net/note/edit/129510 Del: integrated -- https://main.php.net/note/delete/129510/integrated Del: useless -- https://main.php.net/note/delete/129510/useless Del: bad code -- https://main.php.net/note/delete/129510/bad+code Del: spam -- https://main.php.net/note/delete/129510/spam Del: non-english -- https://main.php.net/note/delete/129510/non-english Del: in docs -- https://main.php.net/note/delete/129510/in+docs Del: other reasons-- https://main.php.net/note/delete/129510 Reject -- https://main.php.net/note/reject/129510 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221331) next »