note 73870 deleted from ref.array by felipe

From: Date: Sun, 30 Dec 2007 19:28:30 +0000
Subject: note 73870 deleted from ref.array by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134524@lists.php.net to get a copy of this message
Note Submitter: piotr dot galas+phpnet at gmail dot com ---- Function which converts array to string but not serialize it. function arraytostring($array) { $text.="array("; $count=count($array); foreach ($array as $key=>$value) { $x++; if (is_array($value)) { if(substr($text,-1,1)==')') $text .= ','; $text.='"'.$key.'"'."=>".arraytostring($value); continue; } $text.="\"$key\"=>\"$value\""; if ($count!=$x) $text.=","; } $text.=")"; if(substr($text, -4, 4)=='),),')$text.='))'; return $text; }

« previous php.notes (#134524) next »