How to create access control for menus in php

Hi

how to create access control menus in php. I want to create where all the menus will be there. when a user logged in to the application he should see only those menus which we give access and remaining menus should be hidden or disable

Thanks

In a table lets say user_type store these:
user_id
user_type

u can start user_id from any number you want, lets say 1001 which means Super admin, 1002 Admin, 1003 user, 1004 and so on…
user_type can be like admin, user etc from above.

Fetch these values and store it in session and show different menu to different users. You might have to store the access level in db for the menu item if want it dynamically. OR can implement it in PHP code some thing like:

if ($user_id == 1001) { //super admin can see all menus
 echo "this menu 1";
 echo "this menu 2";
 echo "this menu 3";
}
elseif ($user_id == 1002) { //admin can see 2nd level menu
 echo "this menu 2";
 echo "this menu 3";
}
elseif ($user_id == 1003) { //user can see 3nd level menu
echo "this menu 3";
}

Just a basic idea to start with.

Good luck!