Skip to main content

Posts

Showing posts from February, 2011

PHP function to remove all character which are not alphabets or numbers

Here is the php function to remove all character which are not alphabets or numbers
to remove the white space just pass the param $removeSpace as 1

function removeNonAlphaNumero( $str , $removeSpace = 0 ){
$return_string = "";
if( trim($str) != "" ){
if($removeSpace )
$return_string = preg_replace("/[^a-zA-Z0-9]/", "", $str);
else
$return_string = preg_replace("/[^a-zA-Z0-9\s]/", "", $str);

}

return $return_string;
}



Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog