PHP Anonymous functions
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3694620/anonymous-functions-pre-php-5-3-0">Anonymous functions pre PHP 5.3.0</a>  </p>
</blockquote>



<p>Hello,</p>

<p>How could I do</p>

<pre><code>$ar = array_filter($ar, function($el) {
    $search = 'New York';
    $name = $ar['name'];
    $potentialNumber = substr($name, strlen($search));
    return ((substr($name, 0, strlen($search)) == $search) &amp;&amp; // starts with NY
            ($potentialNumber == '' || is_numeric($potentialNumber)); // [0-9]*
});
</code></pre>

<p>Before PHP 5.3?</p>
