Jump to content

Avoiding too many "if" nesting


moisesbr

Recommended Posts

HI

I have a code as below. But some times many "if"s can turn the program confuse, specialy if they are at the end of program.

##################################
If if today is sunday

 

= "today is sunday

 

if not suday

 

show HTML code

 

             endif

##############################

 

 

Is is possible to do as below to avoid endif at the end of very long program ?

 

If if today is sunday

= "today is sunday"

 

Stop execution here.  ## here I look for something as a return or cancel command used in other languages
endif

 

show HTML code
 

Link to comment
https://forums.phpfreaks.com/topic/281196-avoiding-too-many-if-nesting/
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.