How to modify an array element?? / Variable usage / The t...
Anonymous User (19/11/2007 10:57 am)
Anonymous User (19/11/2007 10:57 am)
In this section
Contributors
- Graham Brookins Updated
- Adrien Commenter
- Allan Commenter
Comments (3 historical)
-
Re: How to modify an array element??
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??
I mean :
$myArray[$i]++
{set $myArray = $myArray|insert($i,inc($myArray[$i]))|remove(inc($i))}-
Re: Re: Re: How to modify an array element??
{$myArray = $myarray|inc()}
-
-