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 - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -