Skip to content

Instantly share code, notes, and snippets.

@EmanueleMinotto
EmanueleMinotto / gist:5990279
Created July 13, 2013 10:31
PHP Double access utility

Double access utility

This is an utility I made to access to common global variables in a mode I prefer: $_GET -> foo against $_GET['foo'].

Where's the utility?

  • you can use this function for other variables too
  • backward compatibility: array access is allowed too, so $_GET['foo'] is accepted
  • integer and float values will be converted from string to their respective values
  • usage on inclusion
  • prevent not defined cells errors