note 109679 added to function.json-decode

From: Date: Wed, 08 Aug 2012 20:28:34 +0000
Subject: note 109679 added to function.json-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-189965@lists.php.net to get a copy of this message
@geoffrey's example below is invalid. Don't forget that json_decode decodes *json*. So, json_decode("01234") tells the decoder to produce an integer. That has nothing to do with PHP - the JSON string "01234" *is* a JSON representation of an integer. Since Geoffrey intended the result to be a string, he should have had the JSON representation of a string to begin with. Ie json_decode('"01234"'). ---- Server IP: 69.147.83.197 Probable Submitter: 202.68.94.220 ---- Manual Page -- http://www.php.net/manual/en/function.json-decode.php Edit -- https://master.php.net/note/edit/109679 Del: integrated -- https://master.php.net/note/delete/109679/integrated Del: useless -- https://master.php.net/note/delete/109679/useless Del: bad code -- https://master.php.net/note/delete/109679/bad+code Del: spam -- https://master.php.net/note/delete/109679/spam Del: non-english -- https://master.php.net/note/delete/109679/non-english Del: in docs -- https://master.php.net/note/delete/109679/in+docs Del: other reasons-- https://master.php.net/note/delete/109679 Reject -- https://master.php.net/note/reject/109679 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#189965) next »