PHP pass associative array from one function to another wihle keeping keys intact
        Posted  
        
            by 
                veronica
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by veronica
        
        
        
        Published on 2010-12-22T23:46:30Z
        Indexed on 
            2010/12/22
            23:54 UTC
        
        
        Read the original article
        Hit count: 356
        
I have two functions and one array
function A {
  $segments = array();
  $segments['word']=$var1;
  $segments['word2']=$var2;
  $segments['word3']=$var3;
  return $segments;
}
function B {
  $someVar=$segments['word'];
  $someVar1=$segments['word'];
  $someVar2=$segments['word'];
  $vars['other_stuff']...
  return $vars;
}
but I am not passing $segments['word']...word3'] to the second function.
I am passing
$segments[0];
$segments[1];
etc...
How can I pass the keys to second function
$segments['word']
$segments['word1']
$segments['word2']
Thank you,
© Stack Overflow or respective owner