tags:

views:

34

answers:

2

Is it possible for the function?

A: 

Prepend with g? g/regex/

Matt Williamson
Regular expression modifiers are not prepended, and PHP doesn't use g as modifier (http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php).
kiamlaluno
Ah crap, I was thinking of JS. Thanks for catching it.
Matt Williamson
A: 

If you execute, in example

$str = 'hypertext language programming';
$chars = preg_split('/ /', $str);

The array $chars will contain three items (hypertext, language, programming).

kiamlaluno