That's not the problem it should display the $name which was set before the function. <<
Just because you set a variable somewhere in your code doesn't mean a thing to your function. It knows nothing about it!
Where in your example did you pass Show() your $name variable? I didn't see it.
You've either got to pass it the variable, $name, or, as the others have shown you, declare $name as a global. That's poor programming practice, but it will work.
And note that PHP globals take extra handling. Unlike C or C++, they must also be declared inside the body of the function (again, as was shown).
10-4 ?