What did
you do, find the most convoluted and retarded way to fetch a variable in PHP?
It's $_GET[variable].
That long ass code snippet
you Googled sanitizes and splits urls for passing into other variables.
You don't need to strip the special characters out of a page number, because it's a small integer value... and integer values don't contain anything but numeric characters.

Can't figure how
you thought *that* was the way to fetch a variable function, unless
you've never written a line of code in your life and creamed your pants when
you saw the function name, or
are disingenuously trying to cover your ass, by giving out bad advice.
Seriously, how fucking retarded
are you trying to be? The guy's enhancing his resume/CV, not designing a corporate website.