Q:

Not able to share the link in whatsapp which contains parameters in url

I have link which needs to be shared in whatsapp which looks like the one shown below.
<?php 
$temp = 'whatsapp://send?text=http://www.example.com/index.php?
           secid=1&url=/content/575098/ready-opposed.html';
?>

<a href="<?php echo urlencode($temp); ?>">
  <img src="img_uploads/watsapp.png" width="18" height="18"/>
</a>  

So now when I share it through mobile site, in Whatsapp I get only http://www.example.com/index.php?secid=1 but the next parameter url is not there. Just to test if I put url as 1st parameter and secid as 2nd parameter then I receive only url but not secid.
In my scenario only if those 2 parameters is present the page is rendered
Can someone please help me solve this issue.

A:

I'm reviving an old/dead answer, but I had the same problem and solved URLencoding the special chars. 
In this case, convert the & with %26
Some ref:

https://www.w3schools.com/tags/ref_urlencode.asp
http://php.net/manual/en/function.urlencode.php

A:

Just Use The rawurlencode() instead of urlencode()
For example
<?php
$value = 2;
$text = rawurlencode("www.domain.com/products.php?Id=".$value);
?>
<a href="https://api.whatsapp.com/send?text=<?php echo $text; ?>"><i class="fa fa-whatsapp"></i></a>

