-1

Forgive me, I'm clueless when it comes to php. I'm trying to port an old game (legend of the green dragon) over to php 7, and it has the following code, I think it's registering a global 'session' key and using $session on further imports. session_register is deprecated and I'm not sure what =& does.

I read this question but I think all the answers seem to assume that $session is already defined?

session_register("session");
$session =& $_SESSION['session'];

Removing the first line seems to ignore any session related data in game, so how would I port these two lines over?

Community
  • 1
  • 1
simonzack
  • 17,855
  • 12
  • 65
  • 107
  • *This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.* - RTM http://php.net/manual/en/function.session-register.php on that, it includes everything in there to port it to the newer version. – Funk Forty Niner Jan 09 '16 at 16:24
  • @Fred-ii- Thanks, I read the code part but I don't understand how they are equivalent? – simonzack Jan 09 '16 at 16:26

1 Answers1

1

The only thing what you need to do is issue an session_start() to start a session and you can use $_SESSION['anyindex'] to beable to use the session data.

Xorifelse
  • 7,708
  • 1
  • 24
  • 37