I am removing an element from an array in PHP:
$images = array('img1.jpg', 'img2.jpg', 'img3.jpg', 'no-image.jpg');
if (in_array('no-image.jpg', $images)) {
$imgIndex = array_search('no-image.jpg', $images);
array_splice($images, $imgIndex, 1);
}
And then I am checking to make sure the $images
array isn't empty:
if (!empty($images)) {
//Some code
}
But if my array only contains no-image.jpg
and I remove it, will empty()
return true or false?