Php kullanma. Need:
On String Input: "Some terms with spaces between"
OutputArray <String>: {Some, terms, with, spaces, between}
Sen explode
, split
or preg_split
a> kullanabilirsiniz.
explode
sabit bir dize kullanır:
$parts = explode(' ', $string);
split
ve preg_split
normal bir ifade kullanırken:
$parts = split(' +', $string);
$parts = preg_split('/ +/', $string);
Düzenli ifade yarma tabanlı bir örnek yararlıdır:
$string = 'foo bar'; // multiple spaces
var_dump(explode(' ', $string));
var_dump(split(' +', $string));
var_dump(preg_split('/ +/', $string));