note 60318 added to function.implode

From: Date: Tue, 03 Jan 2006 16:39:51 +0000
Subject: note 60318 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-101153@lists.php.net to get a copy of this message
an implementation of adrian at foeder dot de implode_with_keys function for input and update sql statement. function implode_param($glue, $array, $valwrap='', $mode = 0) { /* if mode = 0 output is key and values if mode = 1 output only keys if mode = 2 output only values */ switch ($mode){ case 1: foreach($array AS $key => $value) { $ret[] = $valwrap.$key.$valwrap; } break; case 2: foreach($array AS $key => $value) { $ret[] = $valwrap.$value.$valwrap; } break; default: case 0: foreach($array AS $key => $value) { $ret[] = $key."=".$valwrap.$value.$valwrap; } break; } return implode($glue, $ret); } ---- Manual Page -- http://www.php.net/manual/en/function.implode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60318 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60318&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60318&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60318&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60318&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60318&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60318&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60318&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60318&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101153) next »