PHP Doku:: Change the size of an array - splfixedarray.setsize.html

Verlauf / Chronik / History: (2) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige GrunderweiterungenStandard PHP Library (SPL)DatenstrukturenThe SplFixedArray classSplFixedArray::setSize

Ein Service von Reinhard Neidl - Webprogrammierung.

The SplFixedArray class

<<SplFixedArray::rewind

SplFixedArray::toArray>>

SplFixedArray::setSize

(PHP 5 >= 5.3.0)

SplFixedArray::setSizeChange the size of an array

Beschreibung

public int SplFixedArray::setSize ( int $size )

Change the size of an array to the new size of size.

Parameter-Liste

size

The new array size.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 SplFixedArray::setSize() example

<?php
   $array 
= new SplFixedArray(5);
   echo 
$array->getSize()."\n";
   
$array->setSize(10);
   echo 
$array->getSize()."\n";
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

5
10


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)