Forum Moderators: coopster
$my_s='ASRGREGTGTR----REGREGRE+++RRRRRR....';
is there a way to count the length of the string, excluding non-word characters (+,- or .)?
thank you
Off the top of my head I can think of like 3 other ways to do this, but the one above seems simplest.
$my_s='ASRGREGTGTR----REGREGRE+++RRRRRR....'; $chars = preg_replace("/\W/i","", $my_s);
echo $chars ."<br>"; echo strlen($chars);
Cheers