简体   繁体   中英

I want to get the value of my json uri parameter

我想在我的 url 中获取 PARAMS 的值

app-rolly.lan.beestripe.privsub.net/t/e/?callback=callback&aid=13&alias=PxTRvtD9vCJN0VpmgQlNhtR1d5Ec&ua=chrome-Windows&event=result-click-ad&cb=1476946609765&params=%7B"search_source"%3A"toolbar"%2C"test_id"%3A2%7D

Those all json data you just decode it into array using json_decode()

$ARRAY = json_decode($result,true);

you will get the array value you can access like this

echo $ARRAY['search_source'];

Example :

<?php

$result = '{"search_source":"toolbar","test_id":2}';

$ARRAY = json_decode($result,true);

echo $ARRAY['search_source'];

 ?>

OUTPUT :

toolbar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM