mercredi 21 septembre 2016

If statement to associative array

How to add if statement to associative array?

$menu = array(   ''                  => 'user_menu_general',
                '&b=avatar'         => 'user_menu_avatar',
                '&b=notifications'  => 'user_menu_notifications',
                '&b=social'         => 'user_menu_social',
                '&b=security'       => 'user_menu_security');

I only want to add '&b=notifications' => 'user_menu_notifications' if $value == 1...

Aucun commentaire:

Enregistrer un commentaire