-1

可能重复:
在字符串中分隔以空格分隔的单词

如何拆分字符串例如:“test 12.45”作为测试和 12.45 使用 php?

4

2 回答 2

2

你试过这个explode()功能吗?

于 2012-08-11T05:50:49.923 回答
2
$text = "test 12.45";

$words = explode(" ",$text);

echo $words[0]; 
echo $words[1];
于 2012-08-11T05:51:16.723 回答