$a = "A brigade of two brigade three brigade";
The string is the string that was previously processed, and the space is
Goal: Divide the string into three strings with a space.
We have tested n multiple empty line expressions, and can not use split split;
Also used the explode function is not implemented, please master to help solve it.
Requires a workaround for PHP.
Reply to discussion (solution)
$str = ' Jiangsu Nanjing Qixia District Taishan Street ';
echo $str. "
";
echo $param. "
"; Passed in the string a Brigade two brigade three brigade
$s = explode (' ', $str);
Print_r ($s);
echo "SS". $s [0]. " SS ";
Results page:
Jiangsu Nanjing Qixia District Taishan Street//$STR
A brigade of two brigade Three brigade//$param
Array ([0] = Jiangsu [1] = nanjing [2] = Qixia District [3] = Taishan Street) SS Jiangsu SS
can be divided into normal, switch to $s = explode (", $param);
The results page:
Jiangsu Nanjing Qixia District Taishan Street//$STR
A brigade of two brigade Three brigade//$param
Array ([0] = a brigade of two brigade three brigade) SS a brigade iron-making factory Iron Armour class SS
Hint: A brigade of two brigade Three Brigade//$param in the space for
Please God help to see how to correctly handle $param: A brigade of two brigade three brigade? Is this string swollen???? That's weird, huh?
$str = ' A brigade of two brigade Three brigade '; $arr =explode (", Str_replace (", ", $str));p Rint_r ($arr);//array ([0] = a brigade [1] = two Brigade [2] =&G T Three brigade)
The landlord is OK?
$string = "111 222 333"; Echo htmlspecialchars ($string);
Test it first.
$a = "A brigade of two brigade three brigade"; $a = str_replace (', ', ', $a); $result = Explode (", $a); Echo '
; Echo '';p rint_r ($result); Echo '
';
Array
(
[0] = a brigade
[1] = two Brigade
[2] = three Brigade
)