However, given the edit I was suggesting is very important to the syntax of the solution, I think it is relevant even though it contains only 3 characters. See the answer posted by knittl and notice the variable
$value is used as both function input and in the
foreach loop. I simply suggested changing the function parameter's name to
$values in the 3 locations it is used, but was denied, leaving the post incorrect.
Note: I do realize I could have suggested an entirely different variable name thus allowing the edit, but similar situations have arisen in the past where a simple fix of just a few characters make a significant difference. After all, Stack Overflow is a coding website and syntax is very important.