what is the difference between these two foreach loops ?

Posted by Gaurav Sharma on Stack Overflow See other posts from Stack Overflow or by Gaurav Sharma
Published on 2010-05-24T06:03:18Z Indexed on 2010/05/24 6:11 UTC
Read the original article Hit count: 368

I have seen in cakephp that foreach loop is used like this


foreach($tags as $tag) :
       \\code here
endforeach;

and I used to write this style of foreach


foreach($tags as $tag)
{
     //code here
}

what is the difference between these two foeach loops and which one is better and makes more sense to implement ?

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about best-practices