- preg_match_all: documentation ( source)
- var_export: documentation ( source)
- explode: documentation ( source)
- str_word_count: documentation ( source)
- preg_split: documentation ( source)
<?php
$input = "foo bar, php js double-space apo'strophe 9";
echo 'explode(): '; var_export(explode(' ', $input));
echo "\npreg_split(): "; var_export(preg_split('/ +/', $input, null, PREG_SPLIT_NO_EMPTY));
echo "\nstr_word_count(): "; var_export(str_word_count($input, 1));
echo "\npreg_match_all(): "; var_export(preg_match_all('/[a-z]+/', $input, $output) ? $output[0]: []);