Jump to content

[SOLVED] Passing Array to a function


benphelps

Recommended Posts

I need help passing an array into a function.

 

here is an example

 

function test_function($array){
echo $array["testz"];
}

$array = array(
"testz" => "test",
"testa" => "test",
"testb" => "test"
);

test_function($array);

 

When I try this i get a blank array.  Not sure why.

Link to comment
https://forums.phpfreaks.com/topic/115924-solved-passing-array-to-a-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.