note 99233 added to function.implode

From: Date: Thu, 05 Aug 2010 08:39:32 +0000
Subject: note 99233 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-171385@lists.php.net to get a copy of this message
This is a slightly more flexible and concise version of pr at technoparkcorp's ImplodeToEnglish() function. Works for any length array, but doesn't check for other types. <?php function implodeWithFinal($list, $separator = ", ", $final = " and ") { $last = array_pop($list); return (count($list) ? implode($separator, $list).$final : null).$last; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 87.194.253.32 ---- Manual Page -- http://www.php.net/manual/en/function.implode.php Edit -- https://master.php.net/note/edit/99233 Del: integrated -- https://master.php.net/note/delete/99233/integrated Del: useless -- https://master.php.net/note/delete/99233/useless Del: bad code -- https://master.php.net/note/delete/99233/bad+code Del: spam -- https://master.php.net/note/delete/99233/spam Del: non-english -- https://master.php.net/note/delete/99233/non-english Del: in docs -- https://master.php.net/note/delete/99233/in+docs Del: other reasons-- https://master.php.net/note/delete/99233 Reject -- https://master.php.net/note/reject/99233 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#171385) next »