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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -