Mailing List Archive



Back to the month index Back to the list index

A. R. M. (ali@cafe.sdc.uwo.ca)
Fri, 14 Nov 1997 14:49:55 -0500 (EST)


Date: Fri, 14 Nov 1997 14:49:55 -0500 (EST)
From: "A. R. M." <ali@cafe.sdc.uwo.ca>
Subject: Re: Array in Lite
Message-ID: <Pine.SGI.3.95.971114144518.18582A-100000@cafe.sdc.uwo.ca>

On Fri, 14 Nov 1997, Matt Heller wrote:

->Hi again,
->
-> I am trying to find a good reference/starting point for using
->arrays in Lite. So far I have only found that arrays are supported and
->they can hold any dataype. How does one loop through the array (i.e.
->create a while loop to check the various values?)

Like so:
===========================

        $desc = split($row[21],"\n");
        $i = 0;
        while ( $i < #$desc )
        {
                echo ("$desc[$i]<BR>\n");
                $i++;
        }

===========================

This is a segment from one of my lite-embedded HTML pages.
Contents of $row[21] are split at the points of '\n' (end of line) and put
into an array called $desc

I guess you can understand the rest.