★ wanayoo — archive 1999 http://www.php.net/manual/ja/function.array-unshift.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Arrays
Quick Reference
English version of this pageGerman version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
Arrays
* array
* array_count_values
* array_diff
* array_flip
* array_intersect
* array_keys
* array_merge
* array_merge_recursive
* array_multisort
* array_pad
* array_pop
* array_push
* array_rand
* array_reverse
* array_shift
* array_slice
* array_splice
* array_unshift
* array_values
* array_walk
* arsort
* asort
* compact
* count
* current
* each
* end
* extract
* in_array
* key
* krsort
* ksort
* list
* next
* pos
* prev
* range
* reset
* rsort
* shuffle
* sizeof
* sort
* uasort
* uksort
* usort
Manual: array_unshift
View the source code for this pageSearch the site



Previous page
 array_splice
 Updated
Sat, 12 Aug 2000
array_values 
Next page


array_unshift

(PHP4 )

array_unshift -- 一つ以上の要素を配列の最初に加える

説明

int array_unshift (array array, mixed var [, ...])

array_unshift()は、array の先頭に渡された要素を加えます。リストの要素は全体として加えられるため、 加えられた要素の順番は変わらないことに注意してください。

処理後のarrayの要素の数を返します。

例 1. array_unshift()の例


$queue = array("p1", "p3");
array_unshift($queue, "p4", "p5", "p6");
      
この例により、$queue の要素は次の5つとなります。: "p4", "p5", "p6", "p1", "p3"

array_shift(), array_push(), array_pop()も参照下さい。

注意: この関数は、PHP 4.0で追加されました。


 About Notes


Previous page
 array_splice
 Updated
Sat, 12 Aug 2000
array_values 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.