Skip to content

Instantly share code, notes, and snippets.

@filhodanuvem
Created January 16, 2012 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filhodanuvem/1622299 to your computer and use it in GitHub Desktop.
Save filhodanuvem/1622299 to your computer and use it in GitHub Desktop.
Testing closure
<?php
$h = date('H', strtotime($agenda->getData()));
$horariosPossiveis = array_map(function($v){
return str_replace('%H%', $h,$v);
},$horariosPossiveis);
@jeanpimentel
Copy link

<?php
$h = date('H', strtotime($agenda->getData()));

$horariosPossiveis = array_map(
                        function($v) use($h) {
                            return str_replace('%H%', $h, $v);
                        },
                        $horariosPossiveis
                     );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment