<?php $str = ‘string‘; $chars = preg_split(‘//‘, $str, -1, PREG_SPLIT_NO_EMPTY); print_r($chars); ?> 以上例程会输出: Array ( [0] => s [1] => t [2] => r [3] => i [4] => n [5] => g )
2024-01-16 22:00:28
<?php $str = ‘string‘; $chars = preg_split(‘//‘, $str, -1, PREG_SPLIT_NO_EMPTY); print_r($chars); ?> 以上例程会输出: Array ( [0] => s [1] => t [2] => r [3] => i [4] => n [5] => g )