It seems like my code works to check for null if I do
if ($tx)
or
if (isset($tx))
why would I do the se
Put simply, those comparison are not the same. The first will cast the variable to a boolean, which will fail the check on empty arrays, non-numeric strings and other checks, in which the variable is definitely set. The second check (isset()) tests whether the variable exists at all.
I would never perform the first check (boolean cast) without checking the type of the variable as well.
Not to mention, the first check will throw an E_NOTICE, and I always run with at the maximum error reporting level.