note 41227 added to function.echo

From: Date: Sat, 03 Apr 2004 11:01:50 +0000
Subject: note 41227 added to function.echo
Groups: php.notes 
Request: Send a blank email to php-notes+get-67546@lists.php.net to get a copy of this message
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>"; } ?> But arrays must always have {} around them, including many variables ---- Manual Page -- http://www.php.net/manual/en/function.echo.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41227 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41227&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41227&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67546) next »