First of all check the manual to learn about the str_replace function:
http://uk.php.net/manual/en/function.str-replace.php
str_replace (String replace), searches a given string for particular character/s and replaces them.
So in the code you have given (4th line) :
$s=str_replace("\"",""",$s);
the quote sign (\") is replaced with the " ascii code value within the $s variable.
The 3rd line of your code:
$s=str_replace("'","'",$s);
doesnt seem to make sense as it is replacing the single quote character with the single quote character.