PHP List and Split commands

Phil Davis davis.phil at comcast.net
Sun Jun 13 18:20:55 EDT 2004


I'm no PHP expert, but it seems like you could do this:

    -- make line var into an numerically-keyed array
    split tLine with "|"

    -- make array elements available as simple vars
    put tLine[1] into tVar01 -- first key is 1, not 0
    put tLine[2] into tVar02
    put tLine[3] into tVar03


Or if each item in tList is multi-part
(like "bird=hawk|name=George|wingspan=44"), you could do this:

    split tLine with "|" and "="

Doing this to the example above would give you an array that looks like
this:

    tLine[bird]       with a value of     hawk
    tLine[name]       with a value of     George
    tLine[wingspan]   with a value of     44

Food for thought...

Phil Davis



> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of Derek Bump
> Sent: Sunday, June 13, 2004 12:13 PM
> To: How to use Revolution
> Subject: PHP List and Split commands
>
>
> I'm looking for a command in Rev like the following PHP command...
> list( $tVar01, $tVar02, $tVar03)= split ("\|", $line);
>
> If this exists in Rev then it would make my life a whole lot easier.
>
>
> Derek Bump
> Dreamscape Software



More information about the use-livecode mailing list