note 91015 added to function.json-decode
| From: | soletanattoxadotde at osu1 dot php dot net | Date: | Thu, 21 May 2009 07:59:55 +0000 |
| Subject: | note 91015 added to function.json-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-155817@lists.php.net to get a copy of this message | ||
@Gravis: using
substr( $str, 1, -1 )
is a bit easier to read. In addition your preg_replace() might fail on strings (as values in $str)
containing colon as a literal a better parser would properly recognize, e.g.
({title:"Yellow Pages: Who do you want to call today?"})
Aside from that preg_replace() supports "\w" which might reduce your pattern.
----
Server IP: 217.13.201.10
Probable Submitter: 94.222.30.24
----
Manual Page -- http://www.php.net/manual/en/function.json-decode.php
Edit -- https://master.php.net/note/edit/91015
Del: integrated -- https://master.php.net/note/delete/91015/integrated
Del: useless -- https://master.php.net/note/delete/91015/useless
Del: bad code -- https://master.php.net/note/delete/91015/bad+code
Del: spam -- https://master.php.net/note/delete/91015/spam
Del: non-english -- https://master.php.net/note/delete/91015/non-english
Del: in docs -- https://master.php.net/note/delete/91015/in+docs
Del: other reasons-- https://master.php.net/note/delete/91015
Reject -- https://master.php.net/note/reject/91015
Search -- https://master.php.net/manage/user-notes.php