object - php pass array to function as separate variables -


i need know how pass array function separate variables, instance,

function myfunction($var, $othervar) { }  $myarray = array('key'=>'val', 'data'=>'pair'); 

here running problems, following doesn't seem work:

$return = myfunction(extract($myarray)); 

it should, if understand correctly, same as

$return = myfunction($key, $data); 

where $key='val' , $data='pair'

can please explain me.

if understanding question right try this

$return = myfunction($myarray["key"],$myarray["data"]); 

here passing associative array arguments.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -