- Script1.php
Here script1.php calls the function that is in script2:
sendData($variavel);
- Script2.php
The function receives the value and includes the script 3 to receive the values of the arguments:
sendData(){
$getFirstArgumentValue = func_get_arg(0);
// $getVariableName = ...
sendVariableNameAndValue($getFirstArgument);
// global $variavel;
include('script3.php');
}
- Script3.php
In script3.php it is declared the variable called in script1.php, and it is notorious that an error message appears:
echo($variavel);
The error message appears in script3 warning that $ variable has not been declared.
The question is:
How do I declare in script3, the same variable that was declared in script1, passing through the function declared in script2 and receiving this value in script3?
In this case would the sendData function have to get the value of the argument and also the name of the variable used to send this value?
Would it be possible to send the value and name of the variable?