Forum Moderators: coopster
$my_name = "someguy";if ( $my_name == "someguy" ) {
echo "Your name is someguy!<br />";
}
echo "Welcome to my homepage!";
however I want the change this so that the script also matches when $my_name is also "someguy widget"or "widget someguy"
I want to allow for infinite possibilites so listing
"someguy widget" or "widget somguy" will not work
I tried reducing '==' to just '=' but I ended up matching absolutely everything.
>>>>>>>>>>>>>>>>>>>>EDIT>>>>>>>>>>>>>>>>>>>>
Sorry Guys just discovered the world of preg_match
if (preg_match('/someguy/', 'someguy widget'))
echo "Welcome to my homepage!";
As for the equal sign versus double equal sign, that is the difference between assignment and equality. Message #4 in this recent discussion offers some insight ...
[webmasterworld.com...]