note 41227 deleted from function.echo by vrana
| From: | vrana@php.net | Date: | Mon, 27 Sep 2004 09:01:21 +0000 |
| Subject: | note 41227 deleted from function.echo by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77424@lists.php.net to get a copy of this message | ||
Note Submitter: black_revolution at hotmail dot com
----
If using an optional function you can decide which function to be included, this is helpful for
deciding the style of the row being used:
<?php
$array = array( "Number one" , "Number two" , "Number three" );
$count = count($array);
for($i=0;$count>$i;$i++) {
$style = $count ? 'style1' : 'style2';
echo "<div class='{$style}'>{$array[$i]}</div>";
}
?>
When displaying data from an array - you must always have {} around the variable.