<?php
//根據空格切開
$NewString1 = preg_split("/[\s,]+/", "How are you?");
print_r($NewString1);
echo '<br>'; //換行
//把每個英文字母切開
$NewString2 = 'This is my car.';
$NewString2 = preg_split('//', $NewString2, -1, PREG_SPLIT_NO_EMPTY);
print_r($NewString2);
?>
//根據空格切開
$NewString1 = preg_split("/[\s,]+/", "How are you?");
print_r($NewString1);
echo '<br>'; //換行
//把每個英文字母切開
$NewString2 = 'This is my car.';
$NewString2 = preg_split('//', $NewString2, -1, PREG_SPLIT_NO_EMPTY);
print_r($NewString2);
?>