JUtility/array unshift ref
From Joomla! Documentation
< 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[edit]
Prepend a reference to an element to the beginning of an array. Renumbers numeric keys, so $value is always inserted to $array[0]
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 />