hello., please guys how to print two defrant divs in while loop, example this pic
2 divs in while loop!
Started on the old forum in July 2011 · view the original in the archive · old links redirect here
why not!
while
{
echo "<div class='text'><div class='title'>$abcd whatever</div>$efgh notever !</div>";
}
khan wrote: while { echo*"<divclass='text'><divclass='title'>$abcdwhatever$efghnotever*!"; }*
But will it work??
I'm Proud to be a Sri Lankan!
well i found it at another site so im decided to share it..
<?php
for($i=0;$i<5;$i++) {
$post_bg = ($bg++%2 == 0) ? "black" : "white";
echo "<div style='background-color: $post_bg'>text</div>";
}
?>
this printing text with black bg text with white bg if u will use it at while loop replace $i<5 to $i<1 😉
Use array brot
Added after 6 minutes:
This is easy
if($css=="css1") { $css=="css2"; }else{ $css=="css1"; }
in the sql result
echo ""; echo "wathever "; echo "";
There are unlimited choises for this where many of them are posted here, so just copy one that you like, Atef.
mysterio.al - programming is a functional art
