2016-07-26 72 views
3
if(!empty($_GET['new_time'])){ 

    $sql2 = "SELECT * FROM ".$table_name." WHERE id=".$_GET['new_time']; 
    $result2 = mysqli_query($conn, $sql2); 
    $rows = mysqli_fetch_assoc($result2); 
    $mobile_number = $rows['mobile_number']; 
    // Create instance with key 
    $key = 'AIzaSyD1tPfs4s2dYYHMkCOqNZoVsTkDyud-9Yg'; 
    $googer = new GoogleURLAPI($key); 


    $message = lang_content(98, $rows['preferred_language'])." ".$shortDWName; 
    $send_sms($mobile_number,$message,$city_id); 
} 

如果有人觸發new_time,則會出現此錯誤。PHP錯誤:函數名稱必須是字符串/未定義變量send_sms

send_sms is a function to send a message.

+3

從'send_sms'函數中刪除'$'符號,所以調用函數如''send_sms($ mobile_number,$ message,$ city_id);' –

回答

5

你並不需要在功能名稱添加$同時調用該函數:

只使用send_sms($mobile_number,$message,$city_id);

1

可以通過調用它的名字叫功能

send_sms($mobile_number,$message,$city_id); 

declare a var可以在該變量中調用函數調用

$sendsms=send_sms($mobile_number,$message,$city_id); 
相關問題