I try to combine strtolower
and preg_replace
, but I am not sure how to nest it. I have tried it like so:
$res = strtolower(preg_replace("/[^a-zA-Z]/", "", $string));
I found this solution but cannot get it to work. I want a lowercase string without special characters:
I am some special-content
turns into
iamsomespecialcontent
How can I achieve this and store it inside $res
?