Well, the spaces come from the API source, and the parser doesn't remove them for some reason...
You could simply add a trim() in grabVar()...
code:
function grabVar($data, $var) {
$tvar = trim($data[$var]);
return ($tvar == "" ? "Information not available" : $tvar);
}