There is an easier way, you undo all the nasty things magic quotes gpc has done in the begining of your code. This has a major advantage since the script only needs to check if magic quotes gpc is on once, if it's on the script can then strip all slashes from arrays and strings at once.
You could use this snippet to do this.
-----------------------
http://jiart.org/
My digital playground with it's own sandbox.
Well anyway, I love programming