php - Calling Array Function -


how create input argument , call function defined below?

function insert_data ($var) {     $set_entry_array = array(         array('name' => 'name' ,'value' => $var['phone']),         array('name' => 'email' ,'value' => $var['circle']),                             array('name' => 'assigned_user_id' ,'value' => 1),     ); } 

i want call function pass actual value in name , email parameter.

your function accepts array. need define array, , pass function. appears function expects 2 array keys set: phone , circle. need set them.

$myarray = array(); $myarray['phone'] = '555-1234'; $myarray['circle'] = 'foo@bar.com';  insert_data($myarray); 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -