PHP - If something is the case, do nothing

sonic

New Member
Is this a proper way to say: if something is the case, do nothing?\[code\]if ( ($hostNameInfo == $hostNameInput) && ($hostAddressInfo == $hostAddressInput) ){ return;}\[/code\]Update:I'm not inside a function. :(So the return is just nonsense. Here is more code:\[code\]//if the input fields are equal to database values, no need to update and waste resources,hence, do nothing:if ( ($hostNameInfo == $hostNameInput) && ($hostAddressInfo == $hostAddressInput) ){ //do nothing}//If, however, (they are NOT equal and) input fields are not empty:elseif (!empty($hostNameInput) && (!empty($hostAddressInput))){ //do something.}\[/code\]Thanks in advance,MEM
 
Back
Top