note 49118 added to function.explode

From: Date: Mon, 17 Jan 2005 12:03:20 +0000
Subject: note 49118 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-83493@lists.php.net to get a copy of this message
here is a way for exploding a variable and get it to an array. For example you could hang on a word onto this array <?php $var="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"; $var1=explode(" ", $var); foreach ($var1 as $value) { $var2[]=$value." Frank"; } echo "<pre>"; print_r($var2); echo "</pre>"; foreach ($var2 as $value) { echo ($value)."<br>\n"; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.explode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49118 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49118&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49118&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49118&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49118&report=yes&reason=useless+example Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49118&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49118&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83493) next »