★ wanayoo — archive 1999 http://fr.php.net/manual/de/function.array-pad.phpNouvelle recherche | Portail wanayoo
PHP Tuesday, March 20, 2001  
downloads | documentation | faq | support | reporting bugs | links 

search for in the  

lookup:
PHP HandbuchPHP Handbuch
ArraysArrays
 arrayarray
 array_count_valuesarray_count_values
 array_fliparray_flip
 array_keysarray_keys
 array_mergearray_merge
 array_merge_recursivearray_merge_recursive
 array_multisortarray_multisort
 array_padarray_pad
 array_poparray_pop
 array_pusharray_push
 array_randarray_rand
 array_reversearray_reverse
 array_shiftarray_shift
 array_slicearray_slice
 array_splicearray_splice
 array_unshiftarray_unshift
 array_valuesarray_values
 array_walkarray_walk
 arsortarsort
 asortasort
 compactcompact
 countcount
 currentcurrent
 eacheach
 endend
 extractextract
 in_arrayin_array
 keykey
 krsortkrsort
 ksortksort
 listlist
 nextnext
 pospos
 prevprev
 rangerange
 resetreset
 rsortrsort
 shuffleshuffle
 sizeofsizeof
 sortsort
 uasortuasort
 uksortuksort
 usortusort

previousarray_multisort
array_popnext

Last updated: Tue, 20 Mar 2001
view this page in English | Brazilian Portuguese | Czech | Dutch | French | German | Hungarian | Italian | Japanese | Korean | Spanish | Plain HTML

array_pad

(PHP 4 >= 4.0b4)

array_pad -- Pad array to the specified length with a value

Description

array array_pad (array input, int pad_size, mixed pad_value)

array_pad() returns a copy of the input padded to size specified by pad_size with value pad_value. If pad_size is positive then the array is padded on the right, if it's negative then on the left. If the absolute value of pad_size is less than or equal to the length of the input then no padding takes place.

Beispiel 1. array_pad() example


$input = array(12, 10, 9);

$result = array_pad($input, 5, 0);
// result is array(12, 10, 9, 0, 0)

$result = array_pad($input, -7, -1);
// result is array(-1, -1, -1, -1, 12, 10, 9)

$result = array_pad($input, 2, "noop");
// not padded
      

previousarray_multisort
array_popnext

Last updated: Tue, 20 Mar 2001
add note | about notes

show source | credits | mirror sites:  

Copyright © 1998-2001 The PHP Group
All rights reserved.
This mirror generously provided by: L'Université Michel de Montaigne Bordeaux III
Last updated: Tue Mar 20 11:55:11 2001 MET