• PHP Video Tutorials

PHP - Ds Sequence unshift() Function


Advertisements

Ds\Sequence::unshift() function can add values to the front of a sequence.

Syntax

public abstract void Ds\Sequence::unshift([ mixed $values ] )

Ds\Sequence::unshift() function can add values to the front of a sequence, moving all current values forward to make room for new values.

Ds\Sequence::unshift() function doesn't return any value.

Example

<?php
   $sequence = new \Ds\Vector([1, 2, 3]);
   $sequence->unshift("a");
   $sequence->unshift("b", "c");

   print_r($sequence);
?>
php_function_reference.htm
Advertisements