21,886
社区成员
发帖
与我相关
我的任务
分享
$string="111 222 333";
echo htmlspecialchars($string);
先测试一下
$a = "一大队 二大队 三大队";
$a = str_replace(' ',' ', $a);
$result = explode(' ', $a);
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
echo '<pre>';
print_r($result);
echo '</pre>';
Array
(
[0] => 一大队
[1] => 二大队
[2] => 三大队
)
$str='一大队 二大队 三大队';
$arr=explode(' ',str_replace(' ',' ',$str));
print_r($arr);
//Array ( [0] => 一大队 [1] => 二大队 [2] => 三大队 )