Page 1 of 1

Explode PROBLEM

Posted: Tue Jul 27, 2004 3:20 am
by Calimero
explode(" ", $textfield);

This work fine, but ...

I need to explode on this criteria IS IT POSSIBLE?

explode(" some_joker_character some_joker_character ", $textfield);

EXPLANATION: Is there a joker sign, I need to explode the textfield like this: empty space (1 char long) any_word another empty space (1 char long) any_word another empty space (1 char long)

Basicaly the idea is to explode the texfield to get combinations of two words. Is this possible with the explode function and is it possible at all, and how ?

Thanks Ahead !

Posted: Tue Jul 27, 2004 3:35 am
by feyd
[php_man]preg_split[/php_man]('# .\b#',$textfield) maybe...

there are no wildcard characters for explode..

Posted: Tue Jul 27, 2004 3:37 am
by patrikG
[php_man]preg_split[/php_man] splits strings along matches regular expression patterns. Try your hands at regular expression, they're complicated, but worthwhile getting into.