note 51277 deleted from function.implode by nlopess

From: Date: Fri, 25 Mar 2005 16:10:41 +0000
Subject: note 51277 deleted from function.implode by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-86983@lists.php.net to get a copy of this message
Note Submitter: bart at mediawave dot nl ---- 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?... ;)

« previous php.notes (#86983) next »