note 58360 added to function.serialize
| From: | pavic at ieee dot org | Date: | Tue, 01 Nov 2005 19:18:20 +0000 |
| Subject: | note 58360 added to function.serialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97941@lists.php.net to get a copy of this message | ||
Hi, if You get code like
d:234 and than string You wanted, it's the problem, that
s dot marechal at jejik dot com
explanied.
Well, here is a workaround for that problem, function safe serialize, which won't produce that
unwanted chars...
function safe_serialize($string) {
return preg_replace("/(\n)|(\r)/"," ",$string);
}
----
Manual Page -- http://www.php.net/manual/en/function.serialize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58360
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58360&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58360&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58360&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58360&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58360&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58360&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58360&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58360&report=yes
Search -- http://master.php.net/manage/user-notes.php