How can remove special character in string using php


   
       <?php
         public  function remove_special_character($text){
           $text = preg_replace('~[^\pL\d]+~u', '-', $text);
           $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
              $text = preg_replace('~[^-\w]+~', '', $text);
              $text = trim($text, '-');
              $text = preg_replace('~-+~', '-', $text);
              $text = strtolower($text);
            if (empty($text)) {
                return 'n-a';
              }
            return $text;
		}
        
        $string = "Business Promotion and Advertisement in Kanpur";
        $result = remove_special_character($string);
        echo $result;
        
        /*Output*/
        
        Business-Promotion-and-Advertisement-in-Kanpur
        
       ?>