(please don't say this is a duplicate, I checked here first ) I have a json file like this
[{"studentName":"ali","studentPhone":"123"},
{"studentName":"veli","studentPhone":"134"}
need to get keys and values separately I am trying something like this
foreach ($jsonArray as $array ) {
if(is_array($array)){
while($bar = each($array)){
echo $bar[1];
}
but gives me this output :
ali123veli134hatca134dursun13444
I have also tried this way :
if(is_array($array)){
foreach ($array as $key => $value) {
echo $value;
}