3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_SESSION['person_role'] = 'admin'; // set for testing demo // Either do your switch case and set variables... $page = "default"; $role = "default"; switch($_SESSION['person_role']) { case 'admin': $page = $role = "admin"; break; case 'operator': $page = $role = "operator"; break; case 'partner': $page = $role = "partner"; break; } ?> Example W/ Switch Case.. <ul> <li class="uk-margin-left uk-margin-right"><a href="<?php echo $page; ?>.html"><?php echo ucwords($role); ?></a></li> </ul> <?php // - OR - // Just use $_SESSION data (assuming sanitized) in the HTML... $_SESSION['person_role'] = 'operator'; // set for testing demo ?> Example just using $_SESSION data.. <ul> <li class="uk-margin-left uk-margin-right"><a href="<?php echo $_SESSION['person_role']; ?>.html"><?php echo ucwords($_SESSION['person_role']); ?></a></li> </ul>
Output for git.master, git.master_jit, rfc.property-hooks
Example W/ Switch Case.. <ul> <li class="uk-margin-left uk-margin-right"><a href="admin.html">Admin</a></li> </ul> Example just using $_SESSION data.. <ul> <li class="uk-margin-left uk-margin-right"><a href="operator.html">Operator</a></li> </ul>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
33.63 ms | 401 KiB | 8 Q