PHP Basic Notation..Probably?
I've never seen this kind of notation before:
..where they use " : "...
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
I'm thinking that this still reads, if have_post() is true (with the function specifics having an array of values that are probably returned), while there is an iteration of values returned, do function (the_post())...?
If this is the case then, where does the ":" come in?...I didn't see this kind of notation in my PHP book...
by the way...this is a line from the Wordpress platform...
Last edited by ChuckB; 06-05-2010 at 01:36 PM.
Looks like they're using the alternate syntax for control structures. While there is nothing "wrong" with that, I'm not a big fan of it since the vast majority of PHP coders use the curly brace syntax, plus I generally frown upon merging multiple statements into one line both for readability and debugging reasons.
Last edited by NogDog; 06-05-2010 at 01:42 PM.
alright..appreciate it...I figured it was just structured differently but read the same...
Originally Posted by NogDog
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)