Is it possible to have a wildcard for a REQUEST_URI statement? For example I want every page that inside the "/test/" directory to show a particular banner. I've put a * in the code below to show where I need the wildcard placed: <? if($_SERVER['REQUEST_URI'] == "/test/*") echo '<a href="/"><img src="test-banner.jpg" border="0"/></a>'; else echo '<a href="/"><img src="/assets/banner.jpg" /></a>'; ?> Code (markup):
hello if(eregi("test/", $_SERVER['REQUEST_URI'])){ echo '<a href="/"><img src="test-banner.jpg" border="0"/></a>';}else{ echo '<a href="/"><img src="/assets/banner.jpg" /></a>'; }?> PHP: Best
Not best; ereg functions have been deprecated and may no longer be available in future versions of PHP. Also, your regex will match on "main_stuff/test/whatever" which is not what was desired.