if elseif else?
I knew that for a long time ago...
Code:
if( one ) ...Code:
if( one ) ... returnWhich one is better? or no matter? |
Re: if elseif else?
this may not be best explanation but here goes.
PHP Code:
|
Re: if elseif else?
Are you sure?
Code:
if( one ) { ...; return; } |
Re: if elseif else?
Quote:
Yes. |
Re: if elseif else?
Quote:
but if your if check has more then 2 else if you should use a switch its better. if( bla ){ ... } else { ...... } is ok for checking one or two things. |
Re: if elseif else?
IF you use only these statements for a function, you not need to use any return, like this:
PHP Code:
|
Re: if elseif else?
Quote:
|
| All times are GMT -4. The time now is 16:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.