note 124392 added to function.addslashes
| From: | fmr at free dot fr | Date: | Wed, 13 Nov 2019 14:20:37 +0000 |
| Subject: | note 124392 added to function.addslashes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213051@lists.php.net to get a copy of this message | ||
incompatibility between the use of addslashes () and serialize ()
$tab['1']['5'] = addslashes("d'accord");
$SQL_tab = serialize($tab);
...
Reread
...
$tab = unserialize($enrg['$SQL_tab ']);
==> gives an empty array
-------------------------------------------------------
Solution with an improbability char like '£':
$tab['1']['5'] = "d'accord";
$tab['1']['5'] = strtr( $tab['1']['5'], "'",
"£");
$SQL_tab = serialize($tab);
...
Reread
...
$tab = unserialize($enrg['$SQL_tab ']);
$tab['1']['5'] = strtr( $tab['1']['5'], "£",
"'");
Frederic
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.195 (proxied: 93.7.224.189)
----
Manual Page -- http://php.net/manual/en/function.addslashes.php
Edit -- https://master.php.net/note/edit/124392
Del: integrated -- https://master.php.net/note/delete/124392/integrated
Del: useless -- https://master.php.net/note/delete/124392/useless
Del: bad code -- https://master.php.net/note/delete/124392/bad+code
Del: spam -- https://master.php.net/note/delete/124392/spam
Del: non-english -- https://master.php.net/note/delete/124392/non-english
Del: in docs -- https://master.php.net/note/delete/124392/in+docs
Del: other reasons-- https://master.php.net/note/delete/124392
Reject -- https://master.php.net/note/reject/124392
Search -- https://master.php.net/manage/user-notes.php