note 124874 added to function.implode

From: Date: Thu, 02 Apr 2020 16:28:58 +0000
Subject: note 124874 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-214406@lists.php.net to get a copy of this message
If you want to use a key inside array: Example: $arr=array( array("id" => 1,"name" => "Test1"), array("id" => 2,"name" => "Test2"), ); echo implode_key(",",$arr, "name"); OUTPUT: Test1, Test2 function implode_key($glue, $arr, $key){ $arr2=array(); foreach($arr as $f){ if(!isset($f[$key])) continue; $arr2[]=$f[$key]; } return implode($glue, $arr2); } ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.195 (proxied: 148.63.228.41) ---- Manual Page -- http://php.net/manual/en/function.implode.php Edit -- https://master.php.net/note/edit/124874 Del: integrated -- https://master.php.net/note/delete/124874/integrated Del: useless -- https://master.php.net/note/delete/124874/useless Del: bad code -- https://master.php.net/note/delete/124874/bad+code Del: spam -- https://master.php.net/note/delete/124874/spam Del: non-english -- https://master.php.net/note/delete/124874/non-english Del: in docs -- https://master.php.net/note/delete/124874/in+docs Del: other reasons-- https://master.php.net/note/delete/124874 Reject -- https://master.php.net/note/reject/124874 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214406) next »