Home PHP Getting Warning: split(): REG_BADRPT when using the split PHP function
 
 
 

Getting Warning: split(): REG_BADRPT when using the split PHP function

PDF Print E-mail

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. '/\?/'
+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!