note 57704 added to function.serialize

From: Date: Tue, 11 Oct 2005 21:07:03 +0000
Subject: note 57704 added to function.serialize
Groups: php.notes 
Request: Send a blank email to php-notes+get-96868@lists.php.net to get a copy of this message
Very short function I made to turn arrays into a string for fwriting, doesnt create unnecessary commas either: <? function arraytostring($array){ $text.="array("; $count=count($array); foreach ($array as $key=>$value){ $x++; if (is_array($value)) {$text.=$key."=>".arraytostring($value); continue;} $text.="\"$key\"=>\"$value\""; if ($count!=$x) $text.=","; } $text.=")"; return $text; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.serialize.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57704 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57704&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57704&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57704&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57704&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57704&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57704&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57704&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57704&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96868) next »