-1

i have a url which pass JSON content like this

script.php?agent={__AGENT_NUMBER__}&type={__CALL_TYPE__}&callerid={__CALL_ID__}&channel={__REMOTE_CHANNEL__}

how can i retrieve the content of agent,type,etc in php ?

i got the code from this page: http://juanelojga.blogspot.com.es/2014/02/usando-external-urls-del-modulo-de.html. This url is to get parameters from a call center

josiland
  • 163
  • 2
  • 11
  • Um... that's not [JSON](http://www.json.org/) at all... These are [`$REQUEST` parameters](http://php.net/manual/en/reserved.variables.request.php). – Lix Dec 08 '14 at 13:02
  • possible duplicate of [Parse query string into an array](http://stackoverflow.com/questions/5397726/parse-query-string-into-an-array) – Lix Dec 08 '14 at 13:03
  • these are simple GET variables, not JSON ... you get it just like you get any other GET or POST variable, then juste remove the curly brackets if there are... – Laurent S. Dec 08 '14 at 13:03
  • i got the code from this page: http://juanelojga.blogspot.com.es/2014/02/usando-external-urls-del-modulo-de.html – josiland Dec 08 '14 at 13:48
  • Do you have the url as a string or do you get a request to this url? – Rangad Dec 08 '14 at 13:54
  • i get a request to this url. is it uses JSONP? – josiland Dec 08 '14 at 13:57
  • this url is to get parameters from a call center – josiland Dec 08 '14 at 14:02

2 Answers2

1

a simple $_GET['agent'] should do the trick.

Nick
  • 429
  • 2
  • 12
0

this is very simple just use the $_GET method to Retrieve contents

<?php echo $_GET['agent']?>
<?php echo $_GET['type']?>
<?php echo $_GET['callerid']?>
Manjeet Barnala
  • 2,975
  • 1
  • 10
  • 20