In this tutorial learn how to Removes single and double quotes from a string using str_replace() method.
Tutorial
Tutorial
<?php
/**
* Strip Quotes
*
* Removes single and double quotes from a string
*
* @param string
* @return string
*/
function strip_quotes($str)
{
return str_replace(array('"', "'"), '', $str);
}
echo strip_quotes("f\\'oo b\\'ar'");
?>
Above Tutorial Output :f\oo `b\ar
No comments:
Post a Comment