thanx mchn <3
Posts made by isuru mahesh perera
-
RE: PHP Logic problem
<?php $permissions = ['create_user', 'create_post','edit_post', 'delete_post', 'edit_user', 'delete_user']; $permission_categories = []; foreach ($permissions as $value) { $name = explode("_", $value); # hasn't key if(!array_key_exists($name[1], $permission_categories)){ $permission_categories[$name[1]] = []; } $permission_categories[$name[1]][] = $name[0]; } print_r($permission_categories);