Fix a string with an apostrophy
Posted: Wed Jun 11, 2008 4:23 pm
For SQL Server, I need to replace an apostrophe with a double apostrophe. Is there a built in function that will do it?
Thank you...
Todd
/* Fix a string with a apostrophy */
function fix_string($string) {
for ($i=0;$i < strlen($string);$i++) {
if ($string[$i] == "'") $result = $result . "'";
$result = $result . $string[$i];
}
return $result;
}
Thank you...
Todd
/* Fix a string with a apostrophy */
function fix_string($string) {
for ($i=0;$i < strlen($string);$i++) {
if ($string[$i] == "'") $result = $result . "'";
$result = $result . $string[$i];
}
return $result;
}