note 106199 added to function.implode

From: Date: Tue, 18 Oct 2011 12:01:51 +0000
Subject: note 106199 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-183954@lists.php.net to get a copy of this message
Dont know if usefull... <?php function implode_r( $glue, $array ) { $returnstring = array(); if ( is_array( $array ) ) { foreach ( $array as $value ) { if ( ! is_array( $value ) ) { $returnstring[] = $value; } else { $returnstring[] = implode_r( $glue, $value ); } } } $returnstring = implode($glue, $returnstring); return $returnstring; } $test = array("a","b",array("c","d"),"e",array(array("f","g),"h)); print_r (implode_r(",",$test)); //will return "a,b,c,d,e,f,g,h" ?> ---- Server IP: 69.147.83.197 Probable Submitter: 217.91.53.220 ---- Manual Page -- http://www.php.net/manual/en/function.implode.php Edit -- https://master.php.net/note/edit/106199 Del: integrated -- https://master.php.net/note/delete/106199/integrated Del: useless -- https://master.php.net/note/delete/106199/useless Del: bad code -- https://master.php.net/note/delete/106199/bad+code Del: spam -- https://master.php.net/note/delete/106199/spam Del: non-english -- https://master.php.net/note/delete/106199/non-english Del: in docs -- https://master.php.net/note/delete/106199/in+docs Del: other reasons-- https://master.php.net/note/delete/106199 Reject -- https://master.php.net/note/reject/106199 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#183954) next »