Skip to the content
Documentation

How to modify an array element?? / Variable usage / The t...

No ratings yet

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

Comments (3 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. 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?

    1. Re: Re: How to modify an array element??

      Adrien ·

      I mean :
      $myArray[$i]++
      {set $myArray = $myArray|insert($i,inc($myArray[$i]))|remove(inc($i))}

      1. Re: Re: Re: How to modify an array element??

        Allan ·

        {$myArray = $myarray|inc()}

Comments

Add a comment

Comments are read by a moderator before they appear.