php - Replace symbol with preg_replace -



php - Replace symbol with preg_replace -

can utilize str_replace replace symbol?

lets want

<!-- hello there -->

to

[hello]

i might easy some, still learning str_replace , preg_replace

you can pass 2 arrays str_replace function. example:

$find = array('<!-- ', ' there -->'); $replacewith = array('[', ']'); $string = '<!-- hello there -->'; $hello = str_replace($find, $replacewith, $string);

check doc.

php regex replace preg-replace

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -