How to replace text with regex on PHP? -
i have text "master_lecture.name" want replace *master_lecture* space or string. how on regex php?
*i'm newbie regex. thanks
you can regular expression or simple string function
$string = 'master_lecture.name'; $string_replace = 'master_lecture'; // regular expression preg_replace('/'.preg_quote($string_replace).'/is', '', $string); // string function $string = str_replace($string_replace, '', $string);
Comments
Post a Comment