note 107866 deleted from function.explode by googleguy
| From: | googleguy@php.net | Date: | Thu, 22 Nov 2012 16:51:13 +0000 |
| Subject: | note 107866 deleted from function.explode by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192090@lists.php.net to get a copy of this message | ||
Note Submitter: ali balouch
----
exploding string.......
<?php
//(,'')
$array2 = array();
$string2 = "this is a car";
$whitspace = " ";
$increment=0;
$length = strlen($string2);
for($i=1;$i<$length;$i++){
$char = substr($string2,$i,1);
if($whitspace == $char){
$increment++;
}
elseif($whitspace==""){
$array2[$increment].= $char;
$increment++;
}else{
$array2[$increment].= $char;
}
}
var_dump($array2);
?>