Is it possible to check a string for a substring plus a wild character?
I am checking a url for a substring and I know there is the substring function but I am wondering if you can use the * character? Below is my function so far.
function press_getUrl(){
$valid = true;
$current_url = $_SERVER['REQUEST_URI'];
//This is where I am checking for a substring plus whatever is after.
if ($current_url == "/search/node/*"){$valid = false;}
return $valid;
}
$pressValid = press_getUrl();
You don’t need no wild characters for substring.
However, I see no use for such a function at all. what you’re trying to get?
It would make sense for me if it was at least
and then called
but I am not sure of the use of this function.
also a note on the name. your function return no urls. so, don’t use “get” in it’s name.
and don’t mix naming conventions.