Skip to content

Instantly share code, notes, and snippets.

@c9s
Created May 3, 2016 12:47
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 c9s/b1f527df9a50d8f7cd03563c5610500c to your computer and use it in GitHub Desktop.
Save c9s/b1f527df9a50d8f7cd03563c5610500c to your computer and use it in GitHub Desktop.
<?php
$phase1Result = array_filter($input, function($item) { .... });
$phase2Result = array_map(function($item) use ($ex1, $ex2) {
.... do something
}, $phase2Result);
$phase3Result = array_map(function($item) use ($a1, $a2) {
.... do something
}, $phase3Result);
// 組合在一起
$finalResult = array_map(function($item) use ($a1, $a2) {
.... do something
}, array_map(function($item) use ($ex1, $ex2) {
.... do something
}, array_filter($input, function($item) { .... })));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment