What is the ” : ” Operator in PHP and how can i use it?

o, i am not a PHP Ultra Pro programmer but I have been using it for a while in my projects… Recently I have accepted to take part in a WordPress Template for Blog project and, looking into WordPress’ documentation found this piece of code:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

I have never seen that ” : ” operator in PHP and would like to know how does that work and how can i use it in my projects… It seems like a time saver for me, so if anybody could help, that would be great!

Read More

Also, I can understand that it powers a if statement, than a while inside that if, can’t figure the_post(); though, is that a function?

Related posts

1 comment

Comments are closed.