Created
December 3, 2023 05:33
-
-
Save ajangrahmat/9dbfbe59ff5f02a0af329ffcc534b406 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$phone = '6281000000000'; | |
$text = 'Tes kirim pesan'; | |
$apiKey = '0000000'; | |
$url = 'https://api.callmebot.com/whatsapp.php'; | |
$data = array( | |
'phone' => $phone, | |
'text' => $text, | |
'apikey' => $apiKey | |
); | |
$options = array( | |
CURLOPT_URL => $url . '?' . http_build_query($data), | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_SSL_VERIFYPEER => false, // Hati-hati penggunaan ini di lingkungan produksi | |
); | |
$ch = curl_init(); | |
curl_setopt_array($ch, $options); | |
$response = curl_exec($ch); | |
$err = curl_error($ch); | |
curl_close($ch); | |
if ($err) { | |
echo "Error: $err"; | |
} else { | |
echo "Response: $response"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment