Well, there must be something else going on somewhere. I created a very small php file which contains this code:
<?php
$city = "San Diego";
var_dump($city);
$message = <<< END
<td>City</td><td><input type="text" name="city" value="{$city}"></td>
END;
var_dump($message);
and it produces this:
string 'San Diego' (length=9)
string '<td>City</td><td><input type="text" name="city" value="San Diego"></td>' (length=71)
As you see, it still has the space. So I can’t say why your code behaves differently, perhaps someone with more knowledge can explain?