Getting Warning: split(): REG_BADRPT when using the split PHP function
|
|
|
|
|
Question: Getting Warning: split(): REG_BADRPT when using the split PHP function when I try to split a string after each question mark (?).
eg.
$string = "ABC?DEF?BGT";
list($a,$b) = split('?',$string);Answer: - The reason why this is failing is split gives you the power to use regular expressions
- Use the explode() function insteadÂ
- If you really need to use the split() function try escaping the character eg. '/\?/'
|