note 74811 added to function.json-encode
| From: | rhodes dot aaron at gmail dot com | Date: | Sat, 28 Apr 2007 06:57:58 +0000 |
| Subject: | note 74811 added to function.json-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125940@lists.php.net to get a copy of this message | ||
For the functions below, you can't make the following assumption:
if(is_numeric($s)) return $s;
The reason being that in the case of strings consisting of all numbers and leading zeros (zip codes,
ssn numbers, bar codes, ISBN numbers, etc), the leading zeros will be dropped. Instead, make sure
your variables are the correct data types and use:
if(is_int($s) || is_float($s)) return $s;
----
Server IP: 69.39.81.135
Probable Submitter: 71.192.98.87
----
Manual Page -- http://www.php.net/manual/en/function.json-encode.php
Edit -- https://master.php.net/note/edit/74811
Del: integrated -- https://master.php.net/note/delete/74811/integrated
Del: useless -- https://master.php.net/note/delete/74811/useless
Del: bad code -- https://master.php.net/note/delete/74811/bad+code
Del: spam -- https://master.php.net/note/delete/74811/spam
Del: non-english -- https://master.php.net/note/delete/74811/non-english
Del: in docs -- https://master.php.net/note/delete/74811/in+docs
Del: other reasons-- https://master.php.net/note/delete/74811
Reject -- https://master.php.net/note/reject/74811
Search -- https://master.php.net/manage/user-notes.php