fsn812 29 Junior Poster in Training

This should work:

class replace_this {

public function replace($replace,$replacewith,$inme)
{
$doit = str_replace ("$replace", "$replacewith", $inme);
print("$doit");
}
}

$rp = new replace_this();
$rp->replace(" ",'',"This is text");