It is important to point out that the result of both
SELECT ' '
is the string ' '.
That is, the php mssql functions will return a phantom space for any empty strings.
See http://bugs.php.net/bug.php?id=26996 and http://bugs.php.net/bug.php?id=25777
PHP does not classify this as a "bug" because the MS DBLib cannot tell the difference betwene the two cases. Earlier versions of php trim'd strings automatically.
It may be a good idea to ltrim and rtrim your results in some cases.