Q:

Formatting long if statements in php

What would be a more decent way to format the following lines of code. If not format any other method will also do.
if (
    array_key_exists('type',$handle) &&
    array_key_exists('parent',$handle) &&
    array_key_exists('userName',$handle) &&
    array_key_exists('userId',$handle) &&
    array_key_exists('countryCode',$handle)
)

if(
    ctype_digit($listType) &&
    ctype_digit($listParent) && 
    (ctype_alnum($listUserName) && (strlen($listUserName) >=5 && strlen($listUserName) <=24)) &&    ctype_digit($listUserId) && 
      (ctype_alpha($listCountryCode) &&
    array_key_exists($listCountryCode, $countries))
 )

Also, is something like this doable in php?
bool fTest1 = A == B ;
bool fTest2 = C ;
bool fTest3 = f(1,2,3) ;
bool fSuccess = ( fTest1 | ftest2 ) & fTest3 ;
if ( fSuccess )
...

A:

You can use array_intersect and then do a count to avoid all the if clauses. 
$arr1 = array("a" => "type", "parent", "username", "userId", "countryCode")
$intersect = array_intersect($handle, $arr1)
if(count($intersect) == count($arr1)){
   //Your logic goes here. 
}

Also, all your above "doable" examples look valid to me. 

