isset
is a boolean operator which returns TRUE
or FALSE
. You don't need to compare it to 1
.
if( isset($detail) )
As a side note, just because the variable is set, does not mean it's not empty. You may want to just check that it's not empty:
if( !empty($detail) )