08-21-2009, 11:49 AM
Ce se poate face intr-o astfel de situatie? Trei exemple care sa va rezolve problema rapid si elegant:
1#
PHP Code:
$str = 'Hello world!';
$chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
print_r($chars);
2#
PHP Code:
$text = "Hello world!";
for($i=0;$<strlen($text);$i++){
$letterarray[$i]=$text[$i];
}
print_r($letterarray);
3#
PHP Code:
$str = "Hello world!";
$arr1 = str_split($str);
print_r($arr1);

