Het onderstaand stukje zorgt ervoor dat alles wat tussen een spatie of een plus in een array wordt gezet. Nu wil ik graag wanneer iets tussen dubbele quote's staat dit ook in een keer in de array wordt gezet ongeacht of er nu een spatie of plus teken in staat.
Dus:
$input: test test+test "test test" +test
$output = split("[ +]", $input);
$output[1] = test
$output[2] = test
$output[3] = test
$output[4] = test test
$output[5] = test
Bij google wordt dit namelijk ook gedaan.
Dus:
$input: test test+test "test test" +test
$output = split("[ +]", $input);
$output[1] = test
$output[2] = test
$output[3] = test
$output[4] = test test
$output[5] = test
Bij google wordt dit namelijk ook gedaan.