英[??ft] 美[??ft]

vt.& vi. change; shift gears; remove; get rid of

vt. Change clothes of..., change (clothes); sell , sell; [computer] displace (data)

vi. (car) shift gears; change clothes; muddle through; make a living for oneself

n. Move, transfer, convert; change, change, Transform, replace, replace, swap, make it easier, substitute;

Third person singular: shifts Plural: shifts Present participle: shifting Past tense: shifted Past participle: shifted

php array_shift() function syntax

Function: Delete the first element in the array and return the value of the deleted element.

Syntax: array_shift(array)

Parameters:

Parameter Description
arrayRequired. Specifies an array.

Description: Returns the value of the element removed from the array, or NULL if the array is empty.

php array_shift() function example

<?php
$a=array(0=>"西門",1=>"滅絕",2=>"無忌");
echo array_shift($a); //輸出被刪除的 數(shù)組元素的值
echo "<br>";
print_r ($a); //打印處理后的數(shù)組
?>

Run instance?

Click the "Run instance" button to view the online instance

Output:

西門
Array ( [0] => 滅絕 [1] => 無忌 )


<?php
$a=array(0=>"歐陽克",1=>"無忌",2=>"Peter_zhu");
echo array_shift($a); //輸出被刪除的 數(shù)組元素的值
echo "<br>";
print_r ($a); //打印處理后的數(shù)組
?>

Run Instance?

Click the "Run Instance" button to view the online instance

Output:

歐陽克
Array ( [0] => 無忌 [1] => Peter_zhu )