RE: [PHP-WIN] array
| From: | Asendorf, John | Date: | Thu, 30 Nov 2000 21:04:20 +0000 |
| Subject: | RE: [PHP-WIN] array | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-4204@lists.php.net to get a copy of this message | ||
A variation (for stuff in the middle of the array):
$startingElement = 8;
$endingElement = 12;
for( $i = $startingElement ; $i < $endingElement ; $i++ ) {
echo $Arr[$i];
}
P.S. Don't forget that the first element is 0 (zero)!
---------------------
Founder of
The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium
Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods, Bod
John Asendorf - jasendorf@lcounty.com
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Caesar si viveret, ad remum dareris.
> -----Original Message-----
> From: Boget, Chris [mailto:Chris.Boget@wild.net]
> Sent: Thursday, November 30, 2000 3:52 PM
> To: 'afan'; php-windows@lists.php.net
> Subject: RE: [PHP-WIN] array
>
>
> > As a beginer i PHP, I have "simple" problems with array:
> > Let's say:
> > $Arr = array (a1, a2, a3, a4, a5, ..., a23);
> > echo "$Arr[4]"; - prints 4th element of array
> > But, how can I print only elements, e.g. from 8 to 12? Or,
> > from 15 to the end?
>
> $startingElement = 8;
>
> for( $i = $startingElement; $i < count( $Arr); $i++ ) {
> echo $Arr[$i];
>
> }
>
> Chris
>