Can we use the same variable name in PHP which is used to GET the data. Example: Get variable is $_GET['V'], now can I use $V variable for some other purpose or it will lead to ambiguity?
Can we use the same variable name in PHP which is used to GET
Share
$_GET['V']and$Vare in no way tied together and will occupy different memory. You can use both names.If you change the default PHP configuration to enable
register_globals, $V would be created as well as$_GET['V']if such a query string parameter existed, but you could still overwrite it and use it as a separate variable.register_globalshas not been enabled in the default PHP configuration for several years.