WordPress dynamic widget by location?

try to make a simpler code: change

$side_bar= "'$city-Right'";

to

$side_bar= $city . '-Right';

you have extra ' in $side_bar, the way you’ve done would give you 'Madurai-Right' but you need Madurai-Right, this way

dynamic_sidebar($side_bar)

would be like writing

dynamic_sidebar("'Madurai-Right'")

while you only need

dynamic_sidebar("Madurai-Right")

besides, always avoid variable substitution, concatenation is always more secure.