php - Remove string from string contain specific -


i need this:

string = 'wednesday dynamic date'; 

remove word contain day means remove sunday, monday, tuesday, wednesday. output need dynamic date.

use preg_replace that:

echo preg_replace("/\b[a-z]*day\b/i", '', "wednesday dynamic date");  // output:  dynamic date 

Comments

Popular posts from this blog

java - Unable to make sub reports with Jasper -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -

Passing Variables from AngelScript to C++ -