Global variable to local?

I think your question doesn’t make sense.

If you want a local variable, declare it inside a function.