$collection->map($callback)

Map a function to each item in the collection

  • $callback (function)
  • return ($collection)

Example

function someFunction ($item)  {
  //some function
  }
}
$collection->map('someFunction');