I'm having some problems with split().
I have an expression like the following:
$expression = "this|that|another thing";
The following statement works fine:
$items = split("\|", $expression);
But, when I try to put the delimiter into a variable, like so:
$delim = "\|";
$items = split($delim, $expression);
I get a REG_EMPTY error. I've also tried it without the backslash (escape character), using single quotes, using double backslashes, and everything else I can thing of.
How can I stick the delimiter in a variable (global for use on other pages), such that it will work correctly with the split() function? I'd rather not have to hard-code it. Please advise.