Published on : September 01, 2020
Title | : | Array Combine |
Purpose | : | Create an array by using the elements from one “keys” array and one “values” array |
Syntax | : | [php.array_combine p1=”{array1}” p2=”{array2}” o.set=template.res /] |
Input Parameter | : | Array1 and Array2 |
Return value | : | Returns the combined array. FALSE if number of elements does not match |
Example | : |
[template.set_array x a1=1 a2=2 a3=3 /]
[template.set_array y a4=4 a5=5 a6=6 /]
[php.array_combine p1=”{template.x}” p2=”{template.y}” o.set=template.res /]
[template.echo res /]
|
Output | : | Associative array |
Description | : | We can create an array by using the elements from one “keys” array and one “values” array using this function |