Page 1 of 1

How do I query a string, with a wildcard on the end?

Posted: Thu Jul 13, 2017 11:24 am
by simonmlewis

Code: Select all

$urlshop = $_SERVER['REQUEST_URI'];
if ($urlshop <> "/shop/")
{
echo "<div class='woocommerce-category-description'>
    <div class='description'>$term_object->description</div>
</div>";
}
This is working for us, so that if they are on a shop page, it doesn't show this DIV. But on the Categories, it does.
However, if the shop pages is : /shop/?min_price=1&max_price=2550
Then it fails.

So how do I put a wildcard on the end, so that anything "/shop/*" for example, disables the DIV?

Re: How do I query a string, with a wildcard on the end?

Posted: Thu Jul 13, 2017 12:16 pm
by requinix
Take a look at everything in $_SERVER and see if one of the values looks like the sort of string you want.

Re: How do I query a string, with a wildcard on the end?

Posted: Thu Jul 13, 2017 12:32 pm
by simonmlewis
Did it thru pregmatch. Shouldn't be other pages with that it in.