PHP and javascript snippets you can copy and paste.

Showing posts with label str_remove_singleQuotes php string. Show all posts
Showing posts with label str_remove_singleQuotes php string. Show all posts

Wednesday, March 28, 2007

str_remove_singleQuotes($str)

/**
* Removes single quotes from a string.
*
* @param string $str.
* @return string.
*/

function str_remove_singleQuotes($str){
preg_match("/'(.*?)'/i", $str,$matches);
return isset($matches[1])?$matches[1]:$str;
}