The Json
data ={
"2":
  {
    "routtype":"Transactional", 
    "credit":40000,
    "validity":"4616",
    "availablecredit":"39457"
  }
}
how to extract this data into variable one by one
The Json
data ={
"2":
  {
    "routtype":"Transactional", 
    "credit":40000,
    "validity":"4616",
    "availablecredit":"39457"
  }
}
how to extract this data into variable one by one
 
    
     
    
    assuming $json_array as your array.
$data = json_decode($json_array); 
foreach($data as $dt){
    $routtype = $dt->routtype;
    $credit = $dt->credit;
    $validity = $dt->validity;
    $availablecredit = $dt->availablecredit;
    echo $routtype;
    echo $credit;
    echo $validity;
    echo $availablecredit;
}
