I have this variable for $ipCheck = $home_model->checkIP($id); and after print_r of $ipCheck I am getting bellow results.
[0] => stdClass Object
(
[ID] => 330
[image_ID] => 44
[ip] => 192.168.1.197
[like_count] => 1
[favorite_count] => 0
)
[1] => stdClass Object
(
[ID] => 332
[image_ID] => 44
[ip] => 192.168.1.197
[like_count] => 0
[favorite_count] => 1
)
)
Now I have to set some condition if favorite_count = 0 echo favorite count 0 else favorite count 1.
I have tried with this condition but not working.
<?php if(isset($ipCheck[0]->favorite_count) == 0 or empty($ipCheck[0]->favorite_count)) { ?>
favorite count 0
<br />
<?php }else{ ?>
favorite count 1
<br />
<?php }?>
I am getting every time favorite count 0. Can you help me to fix this condition. I am new and learning php. I will thank full If you help me.
Thanks.
$ipCheck[0]to$ipCheck[1]and in theifargument and see the results. you must learn how to deal with arrays =)$ipCheckand check it's favorite count