Do you want to route your own internet connection through a PHP script, to browse anonymously? Have you looked at existing services, applications, etc. for anonymous browsing?
This is the PHP forum, and you appear to want to write come code. Why? I think you're either asking the wrong questions or wanting to do something that doesn't make sense. This forum is definitely not the place to ask for advice and methods about surfing anonymously in a generic sense.