matak
05-29-2007, 10:48 PM
what pattern i need to use to get every single character from string like this
$chars = "a12&n ul9800\n24";
into array
array([0]=>a[1]=>1[2]=>2[3]=>&[4]=>n[5]=>[6]u ... [11]=>\[12]=>n[13]=>2[14]=>4);
printf
05-29-2007, 11:00 PM
str_split();
<?php
$chars = 'a12&n ul9800\n24';
$array = str_split ( $chars );
print_r ( $array );
?>
matak
05-29-2007, 11:18 PM
Thanks!
And do you know maybe function to sort those chars in string maybe
$string = "acbd";
$sorted ="abcd";
:)
iLLin
05-29-2007, 11:23 PM
http://www.php.net and then do a search for array sort. You will be amazed at the results.
matak
05-29-2007, 11:31 PM
http://www.php.net and then do a search for array sort. You will be amazed at the results.
i know of array sort, wondering about string sort :), any other PHP compatible language, like C will do to