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 -

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Save and close a word document by giving a name in R -