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); 

http://php.net/manual/en/function.preg-replace.php

http://php.net/manual/en/function.str-replace.php


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -