How to pass a php variable inside a Whatsapp link?

Asked

Viewed 282 times

1

I want to create a Whatsapp button that contains the user number registered in the database, but I’m not able to link my variable in this link.

Contato:</b> <a href="https://api.whatsapp.com/send?phone=55"> ${property.contato} </a>

What would be the best solution to solve this ?

1 answer

2


Try it like this:

<?php echo 'Contato:</b> <a href="https://api.whatsapp.com/send?phone=55${property.contato}"> </a> '; ?>

Or so:

<?php echo 'Contato:</b> <a href="https://api.whatsapp.com/send?phone=55$property.contato"> </a> '; ?>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.