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
Post a Comment