I am getting a PHP error while doing a preg_replace
.
Warning: preg_replace(): Compilation failed: invalid range in character class at offset 24 in xxx/item.php on line 53
Line# 53 is this..
$itemid = substr(trim(strtolower(preg_replace('/[0-9_%:\[(&#@!~*).\]\\/-\s+]/','',$rsstitle))), 0, 8);
Basically I am trying to omit all the characters except alphabets. What I am doing wrong? Is there any better and faster/better way of doing this?
Tried several answers suggested here while posting this, but none of them worked.
Thanks