Do mean to check if $a is a non-empty string?
So that it contains just any text?
Then the following will work.
If $a contains a string, you can use the following:
if (!empty($a)) { // Means: if not empty
...
}
If you also need to confirm that $a is actually a string, use:
if (is_string($a) && !empty($a)) { // Means: if $a is a string and not empty
...
}