PHP如何将字符串分解为数组中的6个字母组

时间:2009-11-20 14:45:21

标签: php

$string = 'billiejeanisnotmylover';
$array = some_function($string,6);

$array[0] = 'billie'
$array[1] = 'jeanis'
$array[2] = 'notmyl'
$array[3] = 'over'

你知道some_function会是什么吗?

1 个答案:

答案 0 :(得分:10)

使用str_split

$array = str_split($string, 6);