Skip to content

Instantly share code, notes, and snippets.

@rmak78
Created December 20, 2022 10:36
Show Gist options
  • Save rmak78/4ba9fc35d06bfe56cb2be74e74118df0 to your computer and use it in GitHub Desktop.
Save rmak78/4ba9fc35d06bfe56cb2be74e74118df0 to your computer and use it in GitHub Desktop.
How to send Whatsapp Messages with line breaks etc
<?php
//https://wa.me/+99123456789?text=Line%0aBreak
//The %0a represents the line break
$message = urlencode("**NEW ORDER**")."%0a";
$message .= urlencode("ProductID : $product_id")."%0a";
$message .= urlencode("Product Name : *$product_name*")."%0a";
$message .= urlencode("***************")."%0a";
$message .= urlencode("Customer Name : *$name*")."%0a";
$message .= urlencode("Customer Phone : *$phone*")."%0a";
$message .= urlencode("Customer Address : $address")."%0a";
$message .= urlencode("*****************")."%0a";
$message .= urlencode("Ref: http://$ref_link")."%0a";
echo "<script>
location.href= 'https://wa.me/+923008813455?text=$message'
</script>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment