I think this is what you are going for:
$html .= "<a href="https://wordpress.stackexchange.com/questions/49245/{$tag_link}" title="{$tag->name} {$xyz_city}" class="{$tag->slug}">";
The {$tag->name}
part is a way to insert a function or variable into a “double quoted” string definition. In the case of {$tag->name}
it needs the {curly braces} to get the whole object->method thing to work. You can usually leave the curly braces out when you have a double quoted string and want to insert a variable like $xyx_city
, but its good practice to put them in there anyway just in case the underscore or something else in the name messes up the string parsing.