mercredi 12 juillet 2017

How to check if inside an array PHP

I have the following in menu.php. I need to check whether Session is ok. But I am getting Parse error.

I looked on same questions but I couldn't find out what I want.

<?php

$menu=array();

if(Session::get("home")) {
        $menu[]=array(
            "label" => "Home",
            "link" => APP_ABS_PATH
        );
}

if(Session::get("about"))
{
    $menu[]=array(
        "label" => "About",
        "link" => APP_ABS_PATH.'about'
    )
}

if(Session::get("contact"))
{
    $menu[]=array(
        "label" => "Contact",
        "link" => APP_ABS_PATH.'contact'
    )
}

return $menu;

?>

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire