Actions

API16

JUtility/array unshift ref

< API16:JUtility

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Prepend a reference to an element to the beginning of an array. Renumbers numeric keys, so $value is always inserted to $array[0]



Syntax

array_unshift_ref(&$array, &$value)
Parameter Name Default Value Description
&$array array
&$value mixed

Returns

int

Defined in

libraries/joomla/utilities/utility.php

Importing

jimport( 'joomla.utilities.utility' );

Source Body

function array_unshift_ref(&$array, &$value)
{
        $return = array_unshift($array,'');
        $array[0] =& $value;
        return $return;
}



Examples

Code Examples


Advertisement