A section of PHP code!
This post was last edited by u010250831 on 2014-04-26 22:46:36
if (Is_array ($today)): $i = 0; $__list__ = $today, if (count ($__list__) ==0): Echo "", Else:foreach ($__list__ as $key + $vo): + + $i; $mod = ($i% 2)
?>
What is the code above? ":" What is the symbol? Understand the great God under the detailed explanation!
------Solution--------------------
There are two syntactic constructs for PHP process control. A curly brace represents a statement block, a colon that represents a statement block.
Curly braces indicate that the statement block is used more, and this is not said.
Use the colon ":" Instead of the curly brace "{" On the left, use endif, Endwhile, endfor;, Endforeach, and endswitch; to replace the curly brace "}" on the right.
For example, the following two procedures are the same
$a = 1;
$b = 2;
if ($a = = $b) {
Echo ' a=b ';
}else{
Echo ' a!=b ';
}
$a = 1;
$b = 2;
if ($a = = $b)
: Echo ' a=b ';
Else
: Echo ' a!=b ';
endif
------Solution--------------------