note 60558 deleted from function.explode by betz
| From: | betz@php.net | Date: | Sat, 11 Feb 2006 16:35:26 +0000 |
| Subject: | note 60558 deleted from function.explode by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-103507@lists.php.net to get a copy of this message | ||
Note Submitter: STaRDoGGCHaMP
----
Following code:
<?php
$string = "12345678";
$explode = explode("5",$string);
for($i = 0; $i <= strlen($string); $i++){
if(isset($explode[$i])){
echo "The variable \$explode[$i] exists! <br>";
echo $explode[$i] . "<br><br>";
}
else{
echo "The variable \$explode[$i] doesn't exist!<br><br>";
}
}
?>
produce this output:
The variable $explode[0] exists!
1234
The variable $explode[1] exists!
678
The variable $explode[2] doesn't exist!
The variable $explode[3] doesn't exist!
The variable $explode[4] doesn't exist!
The variable $explode[5] doesn't exist!
The variable $explode[6] doesn't exist!
The variable $explode[7] doesn't exist!
The variable $explode[8] doesn't exist!