i made a function that supposed to feed dual array
my problam is that the varibal is visibale inside the function but when it return it dies with it. :(
thats what i want the function to return
Expand|Select|Wrap|Line Numbers
- function sort($n,$mytimestemp,$mytoatl){
- $ts[$n][0]=$mytimestemp;
- $total[$n][0]=$mytotal;
- return;
- }
Expand|Select|Wrap|Line Numbers
- print_r($ts);
- print_r($total);
but even if i first put them at the top of the code or right affter the functin or righr before the function still they dont get updated with $mytimestemp and $mytotal.
i try to declare it like that :
A:
Expand|Select|Wrap|Line Numbers
- $ts;
- $total;
Expand|Select|Wrap|Line Numbers
- $ts = array();
- $total = array();
Expand|Select|Wrap|Line Numbers
- global $ts;
- global $total;