Hello, fellow programmers,
I have recently had an issue of removing an element from array by knowing element's value, but not the key.
So the example aray is the following:
$aExample = array(0, 2, 5, 7);
My variable is
$iNumber = 2;
So, to remove the 2 from $aExample I had to do the following:
$aExample = array_diff($aExample, array(2));
I bet there is an easier way! Could any of you share your experience and knowledge?
Thanks in advance,
Faifas