brian429 Posted April 26, 2015 Share Posted April 26, 2015 (edited) <?php $id = $_GET['keyword']; echo $id;?> Using my site as http://my site/?keyword=32 - this is just a example would actually be http://my site/?keyword={age:30-50} and the platform I am advertising on passes the age that way. I am curious is there a way to use If for example if $id > 29 or <34 $age = 30 - 34 if $id > 29 or <39 $age = 35 - 39 and so on so it looks more targeted to the user, I feel the above code would look to fake if it called out there exact age. Thanks in advance Edited April 26, 2015 by brian429 Quote Link to comment https://forums.phpfreaks.com/topic/295874-how-would-i-do-this-while-passing-keywords/ Share on other sites More sharing options...
nik_jain Posted April 26, 2015 Share Posted April 26, 2015 I don't think I understand what you require, but the string {age:30-50} is a json encoded string . You can get the value by $string = '{age:30-50}' ; $age_obj= json_decode($string) ; $age = $age_obj->age ; Something like that Quote Link to comment https://forums.phpfreaks.com/topic/295874-how-would-i-do-this-while-passing-keywords/#findComment-1509982 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.