我在 PHP 中有一个函数返回数组但不返回值。
你能告诉我我做错了什么吗
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");
}