I am using this but it is not working:
$replaced = str_replace(''', '"', $text);
Any help would be appreciated.
Try this:
$replaced = str_replace('\'', '"', $text);
OR
$replaced = str_replace("'", '"', $text);