How to clean a string using php code

The following script will be clean a string, this code fill helpful when going send a string to url that means using get method using php. PHP Code function CleaningAString($string)   {    ...