note 31402 added to function.str-replace
| From: | christian at uslfinancials dot com | Date: | Sun, 20 Apr 2003 17:21:41 +0000 |
| Subject: | note 31402 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46852@lists.php.net to get a copy of this message | ||
Using str_replace:
take the serialized string:
a:1:{s:4:"S000";a:2:{s:10:"replaceone";a:1:
{s:9:"PROD_name";s:15:"Canned
Tomatoes";}s:8:"EXP_name";s:4:"Casc";}}
I want to take out the 'replaceone' variable and put in a '1'
$unser = str_replace(array('s:10:"replaceone"'),
array('s:1:"1"') , $DB->data[0]);
// $DB->data[0] is the serialized string
The point of this post is to remind you not to forget to change the 's:' values
--
http://www.php.net/manual/en/function.str-replace.php
http://master.php.net/manage/user-notes.php?action=edit+31402
http://master.php.net/manage/user-notes.php?action=delete+31402
http://master.php.net/manage/user-notes.php?action=reject+31402