arrays - If in_array then include - newbie -
i'm starting php now, , i'm not sure why isn't working:
<!-- begin homepage ads --> <?php $homepage = array("/", "/?subtopic=latestnews"); $currentpage = $_server['request_uri']; if(in_array($homepage==$currentpage)) { include('pages/newsticker.php'); } ?> <!-- end homepage ads -->
any ideas why isn't working? being messing witht code time , couldn't solve it
in_array needs 2 parameters, needle , haystack. change if statement following:
if(in_array($currentpage, $homepage))
for in_array reference, see http://php.net/manual/en/function.in-array.php
Comments
Post a Comment