8

Im building a website in php , i would like to implement whatsapp share button in it .I searched the internet for a while but couldn't find anything can any one explain how it works and how can i implement

Thanks in advance

Faizal Hussain
  • 1,189
  • 2
  • 9
  • 17

2 Answers2

32

This might help you

<a href="https://api.whatsapp.com/send?phone=91XXXXXXXXXX&text=urlencodedtext" target="_blank">WA</a>

phone and text parameters are not mandatory

this works in the mobile browser and pc browser, in pc this will open https://web.whatsapp.com/

I think this might be a better solution.

Dhanu K
  • 9,058
  • 5
  • 23
  • 36
13

Please note that this only works with mobile devices and mobile browsers

use this to share in whatsapp, text= The text to share / link / or anything; if you are using url, dont forget to encode it

<a href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share">Share via Whatsapp</a>
Shivank Verma
  • 310
  • 5
  • 18
Akhil Aravind
  • 5,388
  • 15
  • 34