note 31402 deleted from function.str-replace by alindeman

From: Date: Sat, 17 May 2003 22:09:25 +0000
Subject: note 31402 deleted from function.str-replace by alindeman
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48294@lists.php.net to get a copy of this message
Note Submitter: christian@uslfinancials.com ---- 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

« previous php.notes (#48294) next »