I need to set some style property for webpages. Is there a way to assign this to all the adresses with /index.php/projecten/ instead of putting all of the complete adresses in the code? I’m using the following code:
<ul class="subnavlist" style="display: <?php echo (
!in_array($_SERVER['REQUEST_URI'],
array(
'/index.php/projecten/wonen.html',
'/index.php/projecten/werken.html',
'/index.php/projecten/infrastructuur.html',
'/index.php/projecten/winkel-en-dorpcentra.html',
'/index.php/projecten/parken-en-groen.html',
'/index.php/projecten/recreatie.html',
'/index.php/projecten/stedenbouw.html',
'/index.php/projecten/objecten.html',
'/index.php/projecten/werken/vitalisering-zuidspoor.html',
'/index.php/projecten/werken/uitbreiding-venekoten.html',
'/index.php/projecten/werken/herstructurering-tatelaar.html'
)
)
)? "none" : "block"; ?>" id="sub1">
You can use
substr()