I know this question has been asked but still i am having issue in getting it right
{
"status": "400",
"msg": "List Of Lotteries",
"lotteryRes": {
"result": {
"Disawar": [
"Disawar"
],
"DL Bazzar": [
"DL Bazzar"
],
"Faridabad": [
"Faridabad"
],
"Gaziyabad": [
"Gaziyabad"
],
"X90": [
"X90"
],
"Gali": [
"Gali"
],
"RAJASTHAN ROYAL": [
"RAJASTHAN ROYAL"
],
"Rajasthan Bazaar": [
"Rajasthan Bazaar"
]
},
"lottery_date": [
"2018-03-25 05:30:00",
"2018-03-31 15:20:00",
"2018-03-30 18:15:00",
"2018-03-31 20:20:00",
"2018-04-04 23:00:00",
"2018-04-02 23:25:00",
"2018-04-14 16:00:00",
"2018-04-13 14:00:00"
]
}
}
I want to display the data like
<option>Disawar 2018-03-25 05:30:00</option>
<option>DL Bazar 2018-03-31 15:20:00</option>
for every element above is a respective date and time ,I tried but its giving me errors like : Array to string conversion and someother errors
$json = file_get_contents('url');
$obj = json_decode(stripslashes($json),true);
echo "<a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'> $obj[msg];<span class='caret'></span></a>
<ul class='dropdown-menu'>
<li>$obj[lotteryRes]</li>
Any idea how to do that?