How to modify an array element?? / Variable usage / The t...
Historical. Comments that readers left on the eZ Publish documentation of this topic, kept for reference. They describe earlier versions and are not maintained; the current page for Exponential 6 is Variable usage.
In this section
Contributors
- Adrien Commenter
- Allan Commenter
- Graham Brookins Updated
Comments (3 historical)
Written by readers of the earlier documentation sites, kept as they were.
Re: How to modify an array element??
Adrien ·
Actualy, to have the equivalent to the traditional PHP $myArray[$i]++, I use the following:
{set $counts = $counts|insert($i,inc($counts[$i]))|remove(inc($i))}
Huge, isn't it?
Re: Re: How to modify an array element??
Adrien ·
I mean :
$myArray[$i]++
{set $myArray = $myArray|insert($i,inc($myArray[$i]))|remove(inc($i))}
Re: Re: Re: How to modify an array element??
Allan ·
{$myArray = $myarray|inc()}