I'm trying to remove special characters from a string, preparing it for use in a URL. This is my code as of now:
public function __construct($string) {
$remove = array("!", "'", '"', "(", ")", ";", "@", "&", "=", "$", ",", "/", "?", "%", "#", "[", "]");
var_dump($string);
$this->string = $string;
$this->string = str_replace($remove, "", $this->string);
//$this->string = preg_replace("/[\s_\-:+]+/", "-", strtolower($this->string));
var_dump($this->string);
}
And this is what it outputs:
string(16) "Today's Quiz" string(13) "Today39s Quiz"
That makes no sense... At no point do I convert special characters or anything, so where does the 39 come from? I can't track it down.