[Asterisk-Users] Using Arrays

Martin Pycko martinp at digium.com
Wed May 21 07:18:24 MST 2003


You can imagine that we can simulate arrays like this:

myarray_0=192.168.3.4
myarray_1=192.168.3.1

and refering to it when variable pointer=1

${myarray_${pointer}}

Martin

On Wed, 21 May 2003, Surajee Ratnayake wrote:

> hi,
>
> can we have arrays in contexts?
> i tried like this, but didn't work :-(
>
> declaration
> myarray[0]=192.168.3.4
> myarray[1]=192.168.3.1
>
> usage
> myvalue = ${myarray[${myval}]}
>
> pls tell a way to do this
>
> Thanx a lot
>




More information about the asterisk-users mailing list