Jump to content

Help me Understand


monkeytooth

Recommended Posts

Often when I get stuck on a concept I go looking for answers but today I finally noticed a trend, one of which I don't practice often it seems, or one that I go about in different ways I guess you could say sometimes.

 

Anwyay what I notice is some people code and they will have multiple breaks in the code

<?php some php code if($random){ ?>
some html/or not
<?php } else { ?>
some more html/or not
<?php } ?>

 

then ill see a concept one of which I do more it seems

<?php
if($random){
//building my vars and having it deside what the output is
}else{
//well my logic was off it didnt work right use default values
}
?>
HTML stuff/or not

 

I guess what I am curious about is why some people code one way or another and what between the two if one is more so than the other the best way to code in PHP

Link to comment
https://forums.phpfreaks.com/topic/199151-help-me-understand/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.