我嘗試拆分字符串A1B22C333以獲取數組[0] => A1
,[1] => B22
,[2] => C333
。這是我的失敗嘗試:根據字母后跟數字拆分字符串
$mystring = "A1B22C333";
$pattern = "[\w\d+]";
$arr = preg_split("/".$pattern."/", $mystring);
print_r($arr);
,但我得到: Array ([0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] =>)
有人可以幫助我重新命名的問題,以防止重複的標題? 編輯:Thx rock321957 – Black