Re: Extract data
| From: | CC Zona | Date: | Tue, 04 Dec 2001 17:09:56 +0000 |
| Subject: | Re: Extract data | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76548@lists.php.net to get a copy of this message | ||
In article <200112041647.SAA10076@sun1.hot.ee>, phplistharik@hot.ee (Dan)
wrote:
> Warning: unexpected regex error (14) in c:\program files\apache
> group\apache\htdocs\eztatic\poll.php on line 25
>
> 25: list(q1,q2,q3,q4,q5)= split ("|", $answer, 5);
Split() takes a regex as the first argument. The pipe character ("|") is a
special character in regex, so it needs to be escaped if you intend to use
it as a string literal.
But, as noted in the docs
<http://www.php.net/manual/en/function.split.php>:
"...if you don't require
the power of regular expressions, it is faster to use explode(), which
doesn't incur the overhead of the regular expression engine."
--
CC