Re: doing with string
| From: | Leif K-Brooks | Date: | Wed, 09 Apr 2003 11:13:26 +0000 |
| Subject: | Re: doing with string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143045@lists.php.net to get a copy of this message | ||
Try something like:
function is_empty($str){
return $str;
}
$string = 'abc123xyz456';
$array1 = preg_split('|[0-9]+|',$string);
$array2 = preg_split('|[A-Za-z]+|',$string);
$array = array_merge($array1,$array2);
$array = array_filter($array,'is_empty');
Artur Bereniewicz wrote:
Hi all How can I separate into array numbers and characters for example string "abc123efg456" array "abc","123","efg","456"-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.