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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.