Hi need to change the function ereg_replace("[\]", "", $theData) to preg_replace
Hi need to change the function ereg_replace([\], , $theData) to preg_replace
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To port
ereg_replacetopreg_replaceyou need to put the regex between a pair of delimiterAlso your regx is
[\]is invalid to be used for preg_replace as the\is escaping the closing char class]The correct port is
Also since the char class has just one char there is no real need of char class you can just say:
Since you are replace just a single char, using regex for this is not recommended. You should be using a simple text replacement using
str_replaceas: