I'm just looking to optimize the code below. It works, but I want to see if anyone has a shorter way of writing the following condition:
if(
!empty($_REQUEST['shipping_fname']) ||
!empty($_REQUEST['shipping_lname']) ||
!empty($_REQUEST['shipping_address1']) ||
!empty($_REQUEST['shipping_address2']) ||
!empty($_REQUEST['shipping_city']) ||
!empty($_REQUEST['shipping_state']) ||
!empty($_REQUEST['shipping_zip']) ||
!empty($_REQUEST['shipping_country'])){
/* do stuff in here */
}
As you can see, there are some Request variables I'm checking for. If any of them are not empty, then I'd continue the rest. (for those who have to know, if any shipping info is passed, I'll do validation inside the brackets. Sometimes someone sends just the first, last, and zip.
Again, it works, just wondering if anyone has a shorter methodology.