"data": [
{
"pid": "81",
"fname": "Parth",
"lname": "Tandel",
"pfname": "Parth",
"plname": "Tandel",
"userprofilephoto": "/Images/ProfilePictures/18/DSC_0164.JPG",
"parentprofilephoto": "/Images/ProfilePictures/18/DSC_0164.JPG",
"type": "ALBUM",
"likescount": "1",
"commentscount": "1",
"sharecount": "0",
"sharepid": null,
"uaid": "18",
"ownerid": "18",
"parentid": null,
"title": "newalbum2",
"description": "",
"sharedescription": null,
"imagepath": null,
"previewurl": null,
"previewtitle": null,
"previewshortdescription": null,
"previewimageurl": null,
"createdon": "2017-05-29 15:44:04",
"posttype": "5",
"comments": [
{
"pcid": "21",
"uaid": "31",
"comment": "this is dope",
"fname": "maulik",
"lname": "kanani",
"profPicturepath": "https://www.gravatar.com/avatar/003dbb32079ee5ff19ed75476f562bd1",
"createdon": "2017-06-15 23:50:36"
}
],
"albumimages": [
{
"imagepath": "/Images/18/Albums/newalbum2/Screenshot_from_2017-06-12_15-11-36.png"
},
{
"imagepath": "/Images/18/Albums/newalbum2/Screenshot_from_2017-06-12_15-11-361.png"
},
{
"imagepath": "/Images/18/Albums/newalbum2/Screenshot_from_2017-06-12_15-11-363.png"
},
{
"imagepath": "/Images/18/Albums/newalbum2/Screenshot_from_2017-06-12_15-11-364.png"
},
{
"imagepath": "/Images/18/Albums/newalbum2/Screenshot_from_2017-06-12_15-11-365.png"
}
]
}
My PHP code
<?php
for ($i=0; $i < sizeof($value->albumimages); $i++)
{
$x = count($value->albumimages);
switch($x)
{
break;
default:
if($i == 0 || $i == 1)
{
echo '<div class="col-sm-6 pads5 marb10"> <img class="full" src="'.getapiPath().$imgs->imagepath.'"> </div>';
}
break;
}
}
?>
I want albumimages->imagepath