Re: use of str_split
| From: | Brad Bonkoski | Date: | Thu, 09 Aug 2007 12:12:53 +0000 |
| Subject: | Re: use of str_split | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43894@lists.php.net to get a copy of this message | ||
Looks like the function str_split() is a PHP 5 addition, so I guess it might be because you are using php 4?
You can also do this with substr() function...
Something like this:
<?php
$str = "abcdefg";
$arr = Array();
for($i=0; $i< strlen($str); $i++) {
$arr[] = substr($str, $i, 1);
}
print_r($arr);
?>
HTH
-B
Asim wrote:
Hi when i try to use this function str_split() it shows me as invalid function what is solution i want to split certain length of string into an array bye Asim Jamil - 0092 345 4025907, Pakistan--------------------------------- Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search.