Skip to content

Functions php array

sinsunsan edited this page Dec 11, 2012 · 11 revisions

  • array_shift
    http://fr2.php.net/array_shift
    array_shift() shifts (remove) the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array keys will be modified to start counting from zero while literal keys won't be touched. Return the shifted value.

$array = array(
 '1' => 'value1',
 '2' => 'value2',
);
$array_flipped = array_flip($array);
print_r($array_flipped);

Display

array(
 'value1' => 1,
 'value2' => 2 
);


WIKI by Sébastien Lucas CEO & Funder or Bricks

Clone this wiki locally