i need to define the array values as need. Here i say that the value will be 0 to 2. But i need someway to say the value can be null and also it can be 0 to 1000.
$apartment = array(
0,
1,
2
);
foreach ($apartment AS $apt) {
$userApt = $area->getApartments()->get($apt)->getApartment();
echo $userApt . "<br>";
}
Please note that the value can be 0 and it should stop where there is no available value ...
i mean if get(0) is available it should get the value, if get(1) is not available it should stop there and do nothing , so the main purpose is to get the value where it is available, when it is not available, do nothing...