For a split this simple, I'd recommend using explode("|", $data). split()
uses a regex for the first character (and as others have said, the pipe is
a metacharacter in a regex, so you'll need to use "\|" instead of "|"),
whereas explode() is simply literal. explode() will probably be slightly
faster, too, since it doesn't need to compile the regex, etc., although the
difference will probably be infintesimal.
J
Dan wrote:
> Hello guys
>
> I'm making poll script that stores data like this:
>
> 0|0|0|0|0
>
>
>
>
> But i'm getting this error all the time:
>
> 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);
>
>
> Could any help
>
> Thank you very much in advance
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]