Sergio R Sergi Sergio R Sergi - 1 month ago 5x
PHP Question

Php global and show values

I need show this value in global var global $f_[$id];

In function i have this string


$f_ it´s the string and value inside [] change and assign using the function and the finally values can show as this $f_[0] , $f_[34] , etc , the problem it´s i need something as this :

global $f_[$id];

And i know it´s incorrect writte but for understand me , because i need this value in a global var

I hope understand me , thank´s for the help



I believe that you can only do

global $f_;

As the [$id] is an element of a variable, I am not aware you can only global 1 element. If you want to ONLY pass $f_[$id] you could pass it as a reference

function dothis($value)
   $value = '';//something new

and that will only the address for that single element.