PHP array magic trick and manipulations - WMI

PHP array magic trick and manipulations

  1. manipulating multidimensional array using array_map
  2. /**
    * Ilterate multidimensional array simplicity
    * @desc modify and manipulate or populate multidimensional array with simple tricks
    * @param array $arr
    * @param function $callback
    * @return Array
    function Map($arr, $callback)
      if (!is_callable($callback)) {
        throw new Exception("Callback must be function", 1);
      return array_map(function ($key, $val) use ($callback) {
        return call_user_func($callback, $key, $val);
      }, array_keys($arr), $arr);

Subscribe to receive free email updates:

0 Response to "PHP array magic trick and manipulations"

Post a Comment

Bila Ada posting yang kurang, atau error atau yang lainnya, silahkan tinggalkan komentar agar artikel/post di perbaiki.
Jangan Lupa Cek Box "Notify Me" agar tahu komentar kamu dibalas oleh saya.

If there are any posts that are missing, or error or anything else, please leave a comment for the article / post to be fixed.
Do not Forget Check Box "Notify Me" to know our comments replied by me.