API16

JUtility/array unshift ref

From Joomla! Documentation

< API16:JUtility
Revision as of 17:56, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Prepend a reference to an element to the beginning of an array. Renumbers numeric keys, so $value is always inserted to $array[0] <span class="editsection" style="font...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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[edit]

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

[Edit Descripton]

Template:Description:JUtility/array unshift ref

Syntax[edit]

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

Returns[edit]

int

Defined in[edit]

libraries/joomla/utilities/utility.php

Importing[edit]

jimport( 'joomla.utilities.utility' );

Source Body[edit]

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

[Edit See Also] Template:SeeAlso:JUtility/array unshift ref

Examples[edit]

<CodeExamplesForm />