Is there any library class or method to use not regular expressions and preg_replace() for char replacment?
I mean something where I can get an associative array of chars to be replaced in string?
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.
http://php.net/manual/en/function.strtr.php
usage:
Note, if i understood you, you’re not looking for preg_replace or regex char replacement
edit no.1
if you need to excape this kind of data, use
htmlentitiesorstr_replace