I have the following code
echo '<pre>';
print_r($this->region_id);
echo '</pre>';
if(end($this->region_id) != 0){
if($this->region_id[0] == 0){
array_shift($this->region_id);
}
}
echo '<pre>';
print_r($this->region_id);
echo '</pre>';
Somehow it's not removing the first element of the array, since my results look exactly the same after the code runs with the print_r
Array
(
[0] => 0
[1] => 30
[2] => 14
)
Array
(
[0] => 0
[1] => 30
[2] => 14
)
Am i doning something wrong? And the code does reach the array shift.