note 96114 modified in function.implode by thiago
| From: | thiago@php.net | Date: | Tue, 09 Feb 2010 13:04:57 +0000 |
| Subject: | note 96114 modified in function.implode by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165796@lists.php.net to get a copy of this message | ||
I made another implode-like-function with quotation marks.
<?php
function implode_str( $separator, $arr, $pad = "'", $tail_pad = NULL )
{
if( $tail_pad == NULL ) $tail_pad = $pad;
$res = '';
$c = count($arr);
foreach( $arr as &$node )
$res .= $pad.$node.$tail_pad.((--$c>0)?$separator:NULL);
return $res;
}
?>
--was--
I made another implode-like-function with quotation marks.
function implode_str( $separator, $arr, $pad = "'", $tail_pad = NULL )
{
if( $tail_pad == NULL ) $tail_pad = $pad;
$res = '';
$c = count($arr);
foreach( $arr as &$node )
$res .= $pad.$node.$tail_pad.((--$c>0)?$separator:NULL);
return $res;
}
http://php.net/manual/en/function.implode.php