<?php
$array = array();

for ($i=0; $i < 1000; $i++)
{
  $array[] = $i;
}

array_walk($array, create_function('&$value, $key', '$value = array($value, md5($value));'));
usort($array, create_function('$var1,$var2', 'return strcmp($var1[1], $var2[1]);'));
array_walk($array, create_function('&$value, $key', '$value = $value[0];'));
Published in: PHP
Download

Related snippets