A simple example of color rotation, using ternary operators to make the program concise.
We have seen some of the table cells on the site the background color is interlaced, in fact, with a small section of the following code can be implemented: $color = (($coloralter + +%2)? "E0e0e0": "E8e8e8"), that is, by adding variables and 2, using ternary operator to obtain two different color values.
Examples are as follows:
<title>Test</title>
for ($i =0; $i <5; $i + +) {$color = (($coloralternator + +%2)? "E0e0e0": "ff6666"); echo "
Hello everyone |
"; } ? >
http://www.bkjia.com/PHPjc/316593.html www.bkjia.com true http://www.bkjia.com/PHPjc/316593.html techarticle A simple example of color rotation, using ternary operators to make the program concise. We have seen some of the table cells on the site the background color is interlaced, in fact, with the following ...