Sunday, 11 August 2013

Function is returning the array not value

Function is returning the array not value

I have a function in PHP that is returning the array but not the value.
Can you tell me what I am doing wrong
function get_current_call_count() {
//Variable declearation
$line1="";
$line2="";
$total_call_count="";
$current_call_count="";
$var=array();
// Executing shell command to get total number.
$shell_command = ("/usr/sbin/asterisk -rx 'core show calls'");
exec($shell_command,$result,$status);
//print_r($result);
$line1=explode(" ",$result['0']);
$current_call_count=$line1['0'];
$line2=explode(" ",$result['1']);
$total_call_count=$line2['0'];
$var=array("$current_call_count","$total_call_count");
return($var);
//echo("Current call count is $current_call_count and Total system
call count is $total_call_count");
}

No comments:

Post a Comment