Do I need to enclose PHP built-in functions in parentheses?
Are these the most proper ways?
(empty($UrlArray[1])), (is_numeric($UrlArray[1])), (strlen($UrlArray[1]) == 4)
Or, are these the most proper ways?
empty($UrlArray[1]), is_numeric($UrlArray[1]), strlen($UrlArray[1]) == 4
This one works but I'm wondering if I have too many parentheses.
( ( (empty($UrlArray[1])) OR ( (!empty($UrlArray[1])) AND (is_numeric($UrlArray[1])) AND (strlen($UrlArray[1]) == 4) ) ) AND (count($UrlArray) < 3) )
If I omit the parentheses that enclose the PHP built-in functions the code snippet still works.
( ( empty($UrlArray[1]) OR ( !empty($UrlArray[1]) AND is_numeric($UrlArray[1]) AND strlen($UrlArray[1]) == 4 ) ) AND count($UrlArray) < 3 )
I have always enclosed the PHP built-in functions in parentheses. But I am just wondering if that is the best way.
Thanks.