I have a php page on which I get some data like this
$data = $_GET["data"];
$data is used on the page and inside a function i.e.
function myfunction() {
some code here
}
this function is called many times on this page if needed
my question is what is efficient way to access the data inside the function?
1.
function myfunction() {
$data = $_GET["data"];
}
or 2.
function myfunction() {
global $data;
}