Jump to content

Passing array to a function


macross

Recommended Posts

So this is an example how i would like to get values from array inside a function. ( Note that array is an unknown size.. It might be empty or it might contain 3 keys)

 


$data = array(1=>"hello", 2=>"welcome");

function doSomething($value1, $value2){

//Do something

}

doSomething($data)

 

How can i achieve such thing?

Link to comment
https://forums.phpfreaks.com/topic/264367-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.