split() takes a regular expression,

this means you have to escape the | char with a \

like this:

$rgTemp = split("\|",$szTag);


On Fri, 18 Jan 2002 14:40:25 -0800, PHP List wrote:

>Can someone please tell me why the this is happening:
>1)   $szTag = "test|3";
>2)   $rgTemp = split("|",$szTag);
>3)   $szTag = $rgTemp[0];
>4)   $nItemID = $rgTemp[1];
>^line numbers for ref only, not in actual code.
>Will give me the error:
>PHP Warning:  unexpected regex error(14) in /test.php on line 2
>What is an error 14 ?

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]

Reply via email to