-2
If I’m on the test page/1, it adds the class logoPrincipalHosp
in li if not the class logoPrincipalElev
.
My PHP:
<li <?php if (preg_match('/teste\/1/')) echo 'class="logoPrincipalHosp"';
else (preg_match('/teste\/2/')) echo 'class="logoPrincipalElev"';
?>>
But it’s not working
Shouldn’t be
elseif
instead ofelse
?– Sergio
You’re missing a parameter in
preg_match
=). preg_match– Oeslei
@Sergio was this guy, that lack of attention my, thanks! : D
– Felipe Viero Goulart
@Oeslei actually I just forgot to put the parameter here, in my code it is already. :)
– Felipe Viero Goulart