Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php loop array

<?php

$items = [1, 2, 3];
$multiplier = 2;

$doubledItems = array_map(function ($item) use ($multiplier) {
  return $item * $multiplier;
}, $items);
Source by gist.githubusercontent.com #
 
PREVIOUS NEXT
Tagged: #php #loop #array
ADD COMMENT
Topic
Name
3+5 =