What's the best way to create an array from a comma delineated list?

I have a string assigned to a variable that looks like this: 1,2,3,4

And I would like to create an array so that $arr[0] = 1 and $arr[1] = 2 etc.

It seems so simple but I just can't crack it.

    If you just have a string of numeric values that you wish to parse in this way, you can also use [man]explode/man.

      Thank you very much, explode() works perfectly.

        Hey CFSIH,

        Please mark the thread resolved (Under thread tools)

          Sorry :o forum noob.

          Great forum BTW.

            Write a Reply...