0

I have simple question but i can´t get solution for this

I have function and inside one array , in this array i have all values and if i don´t use the function works , i think about use global vars for extract but i can´t get fix this problem

function get_it($exp_value)
{

foreach($exp_value as $exp_values) {
/// Array Values ///
            ${$exp_table[$j]}[]="".base64_decode($exp_values)."";
///
            /// this no works ///
            global ${$exp_table[$j]};
            ///
            $j++; 
        }

}

The idea it´s use the function for example :

get_it($exp_value);

And get all values with simple arras as for example :

$data[0];$data[1];$data[2];

The problem it´s in the function the code no let me get out the values , i try use ´- as i put inside function - the var "global" , but no get finally results , if don´t use this code inside function works

The Best regards

rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
Francisco
  • 61
  • 9
  • Why don't you just not use global, and return with an array? And you do not initialize your `$j`. – vaso123 Nov 18 '14 at 13:11
  • 1
    Please read the duplicate and learn about function arguments and `return` statements. – deceze Nov 18 '14 at 13:11
  • Can you tell me where inside function i must put retirn ? because i try use in this case return but the values for use in return it´s inside array [] no single string , but this it´s fantastic you tell me this , but n works use return in this case , thank´s – Francisco Nov 18 '14 at 13:17

0 Answers0