Can anyone give me a solution for the below lines of code:
$filteredArray = array_filter($wordArray, function ($x) {
return !preg_match("/^(.|a|an|and|the|this|at|in|or|of|is|for|to|em|com|be
|with|href|me|rt|by|np|http|www)$/x", $x);
});
This line not producing any error in my localhost using XAMPP, but the same line is showing an error in my nginx server (online).
What can I do for this. Why this is showing?
Sounds like your server may not be running PHP 5.3 or later, which is needed to support anonymous functions. Instead, you can create the function and pass it as a callback function string to
array_filter().