JUtility/array unshift ref: Difference between revisions
From Joomla! Documentation
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... |
No edit summary |
||
| Line 17: | Line 17: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$array | ||
| | | | ||
| array | | array | ||
|- | |- | ||
| | | &$value | ||
| | | | ||
| mixed | | mixed | ||
Revision as of 10:19, 30 March 2010
Description
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
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;
}
[Edit See Also] Template:SeeAlso:JUtility/array unshift ref
Examples
<CodeExamplesForm />