I have an array ,$idarray .
array(3) {
[0]=>
string(4) "102"
[1]=>
string(4) "211"
[2]=>
string(4) "421"
}
Call the other function an pass the array element.
foreach($idarray as $id){
$r = get_rate($id);
foreach($r as $result=> $row){
}
}
Another function
function get_rate($qid){
foreach($qids as $qid){
execute sql here
}
Error occur when i pass the array to the function "foreach($qids as $qid)" , then I cannot go into the foreach statement and do the execution. How can I pass an array to the function ?
$r = get_rate($id);here you are passing an array element not an array!!