$roles = ['admin' => 1, 'editor' => 2, 'viewer' => 3]; Need to look up the role name by ID? $lookup = array_flip($roles); // Result: [1 => 'admin', 2 => 'editor', 3 => 'viewer']
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter