如何根据第二个变量
的长度拆分下面的第一个文本变量$text = "hey how are you";
$text1 = "how are you";
$length = strlen($text);
$length1 = strlen($text1);
答案 0 :(得分:0)
使用str_split:
$text = "hey how are you";
$text1 = "how are you";
$length = strlen($text);
$length1 = strlen($text1);
$parts = str_split($text, $length1);
// Array([0] => hey how are [1] => you)