note 33877 deleted from ref.array by sniper

From: Date: Sat, 18 Oct 2003 18:00:35 +0000
Subject: note 33877 deleted from ref.array by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58819@lists.php.net to get a copy of this message
Note Submitter: alan@zeroasterisk.com ---- here are useful functions for submitting a PHP array to a simple text field in mySQL (or other) and then pulling it back into an array (hash friendly)... at this point, it's only 1 demensional... function file_2string($array) { $vals=array_values($array); $keys=array_keys($array); $x=0; while($x<count($keys)) { if ($x!=0) { $result.="|"; } $result.=$keys[$x]."=".$vals[$x]; $x++; } return $result; } function file_2array($string) { $elements=explode("|",$string); foreach ($elements as $element) { $temp=explode("=",$element); $result[($temp[0])]=$temp[1]; } return $result; }

« previous php.notes (#58819) next »