Comunitatea PHP Romania
 

 
array_shift

array_shift

(PHP 4 , PHP 5)

array_shift --  Shift an element off the beginning of array

Description

mixed array_shift ( array array)

array_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. If array is empty (or is not an array), NULL will be returned.

Exemplu 1. array_shift() example

$stack = array ("orange", "banana", "apple", "raspberry");
$fruit = array_shift ($stack);

This would result in $stack having 3 elements left:

Array
(
    [0] => banana
    [1] => apple
    [2] => raspberry
)
and orange will be assigned to $fruit.

See also array_unshift(), array_push(), and array_pop().

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
acasa , in pat
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
Mascka Mascka
Braila
raul_ raul_
whooper whooper
Toronto ON
mihaitha mihaitha
Sibiu
gabysolomon gabysolomon
Bacau
oriceon oriceon
Constanta
garlicinicolae garlicinicolae

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Credit Card Consolidation | Loans | Car Loan | Mortgage | Credit Cards
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis