What does PHP colon (:) do?
-
I’m hacking on a template, specifically comments.php, and I came across the following code snippet, which is confusing. Apparently even the PHP devs find it confusing, according to google. But none of the google results gave me an answer.
Oh? The question? Yes, right away.
What does the colon (:) do at the line ends? I’d like to rewrite it so its less confusing. Thanks.
Mark
if ( $comments ) :
$myvar=0;
foreach ($comments as $comment) :
$myvar++;
if ($myvar == 1) {$swap = "background-color: #eeeee6; padding: 5px;";}
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘What does PHP colon (:) do?’ is closed to new replies.