note 58320 added to function.implode

From: Date: Mon, 31 Oct 2005 12:53:54 +0000
Subject: note 58320 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-97879@lists.php.net to get a copy of this message
...and a mysql-update-statement-compatible implementation of implode_with_keys: <?php function implode_with_keys($glue, $array, $valwrap='') { foreach($array AS $key => $value) { $ret[] = $key."=".$valwrap.$value.$valwrap; } return implode($glue, $ret); } ?> so implode_with_keys(", ", $array, "'") will output: key1='value1', key2='value2' and so on. Useful for UPDATE table SET key1='value1', key2='value2' ---- Manual Page -- http://www.php.net/manual/en/function.implode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58320 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58320&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58320&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58320&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58320&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58320&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58320&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58320&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58320&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#97879) next »