note 71160 deleted from function.strstr by nlopess
| From: | nlopess@php.net | Date: | Fri, 05 Jan 2007 20:34:26 +0000 |
| Subject: | note 71160 deleted from function.strstr by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121339@lists.php.net to get a copy of this message | ||
Note Submitter: aspje at hotmail dot com
----
Why onuryerlikaya uses strstr AND substr just to split a string is not totally clear... also $piece
= 0 would not give the expected result.
the next code gives the exact same thing AND will work for $piece = 0
<?php
$piece = 6;
$data = 'djhfoldafg9d7yfr3nhlrfkhasdfgd';
$piece1 = substr($data,0,$piece);
$piece2 = substr($data,$piece);
echo '$piece1 :'.$piece1; // $piece1 :djhfol
echo "<br>";
echo '$piece2 :'.$piece2; // piece2 :dafg9d7yfr3nhlrfkhasdfgd
?>