note 54533 added to function.implode

From: Date: Thu, 07 Jul 2005 07:22:36 +0000
Subject: note 54533 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-91573@lists.php.net to get a copy of this message
...and another variation of "implode_assoc" function. Just added the boolean parameter $urlencoded; if TRUE returns the array value in URL encod format. If the parameter is not given it behaves like the original function. <? function implode_assoc($inner_glue, $outer_glue, $array, $skip_empty=false, $urlencoded=false) { $output = array(); foreach($array as $key=>$item) { if (!$skip_empty || isset($item)) { if ($urlencoded) $output[] = $key.$inner_glue.urlencode($item); else $output[] = $key.$inner_glue.$item; } } return implode($outer_glue, $output); } ?> ---- Manual Page -- http://www.php.net/manual/en/function.implode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54533 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54533&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54533&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54533&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54533&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54533&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54533&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54533&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91573) next »