Varun Joshi
Varun Joshi

Reputation: 53

How to remove ampersand and get value from url in php

I have a url in which value is coming with ampersand so i want to get value from that url but due to ampersand this value is coming wrong.So is there any way to remove ampersand and get the actual value from the url.Because i have survey website in which whenever user will complete the survey it will automatically redirect on the callback url,so they use ampersand with the variable.

My url is like this:-

http://testdomain.com/webservices/v1/api/survey_submit?ssi=%127%&ssi2=%1.80%

Php code is:-

<?php
echo $_GET['ssi'];
?>

its value should come 127 but it is showing wrong value 7%.Is it possible to get the value ampersand sign.

Upvotes: 0

Views: 254

Answers (1)

Yojan
Yojan

Reputation: 159

Have a look about strtok() at http://php.net/manual/en/function.strtok.php

Upvotes: 1

Related Questions