I've been trying to figure out how to delete a part of an array by its value... for example, if I have an array called $numbers with the values 1, 2, 2, and 3 (with arbitrary keys), how would I go about deleting one of the '2's? I tried using the function:
array_diff( $numbers, array(['2'])
The problem is, this deletes ALL of the elements with the value '2' when I only want to delete one of them. Any ideas?