activeserver Posted April 23, 2008 Share Posted April 23, 2008 Hi all, I'm writing a big app (big for me - 300-500 lines per page - 50+ pages ) and I've decided to use $_SESSION to sore intermediate data. The part for which I'm using $_SESSION is not high-volume - registration and form filling - which will be done *once* by any user, so using $_SESSION may be OK for now High traffic pages will have no memory usage - lest I exceed memory on shared hosting and crash other people's apps I'm completely fed up completely of typing long names like $_SESSION['RegSection']['Email'], $_SESSION['RegSection']['FirstName'] etc. So, I want to ask: Is there a way of using aliases to refer to $_SESSION simply as '$s'? or this: $s =& $_SESSION['RegSection']; followed by $s['Email'] = $something_else; etc etc import_request_variables() is only for GPC - http://php.net/manual/en/function.import-request-variables.php and extract() is not useful either Any help is greatly appreciated TIA Link to comment https://forums.phpfreaks.com/topic/102438-renaming-superglobals-or-using-pointers-or-aliases/ Share on other sites More sharing options...
discomatt Posted April 23, 2008 Share Posted April 23, 2008 Why not just test it out? <?php session_start(); $_SESSION['test']++; $s = &$_SESSION; print_r($s); ?> And refresh the page a bunch of times Link to comment https://forums.phpfreaks.com/topic/102438-renaming-superglobals-or-using-pointers-or-aliases/#findComment-524592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.