note 51276 deleted from function.implode by betz
| From: | betz@php.net | Date: | Fri, 25 Mar 2005 13:56:52 +0000 |
| Subject: | note 51276 deleted from function.implode by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-86974@lists.php.net to get a copy of this message | ||
Note Submitter:
Reason: useless
----
Here's another complicated way to do some more advanced imploding:
<?php
$tables[] = array('table1', 'alias1');
$tables[] = array('table2', 'alias2');
$tables[] = array('table3', 'alias3');
$tables[] = array('table4', 'alias4');
echo implode(', ', array_map('implode', $tables, array_fill(0, count($tables),
' AS ')));
// prints: table1 AS alias1, table2 AS alias2, table3 AS alias3, table4 AS alias4
echo '<br />';
$vars[] = array('var1', 'value1');
$vars[] = array('var2', 'value2');
$vars[] = array('var3', 'value3');
$vars[] = array('var4', 'value4');
echo implode('&', array_map('implode', $vars, array_fill(0, count($vars),
'=')));
// prints: var1=value1&var2=value2&var3=value3&var4=value4
?>
But this still isn't really what we want isn't it?... ;)