Hi, I am getting a PHP string which I need to strip the spaces out of. I have used the following code but when I echo $classname it just displays the string sti
$classname
The problem might be the character not being a space, but another whitespace character.
Try
$classname = preg_replace('/\s/', '', $fieldname);