Hello, I wanted to ask if you have a string like:
is there a way to count the length of the string, excluding non-word characters (+,- or .)?Code:$my_s='ASRGREGTGTR----REGREGRE+++RRRRRR....';
thank you
Printable View
Hello, I wanted to ask if you have a string like:
is there a way to count the length of the string, excluding non-word characters (+,- or .)?Code:$my_s='ASRGREGTGTR----REGREGRE+++RRRRRR....';
thank you
You can create a temp string of only numbers and letters and count that.
PHP Code:$tmp = preg_replace('/[^0-9a-zA-Z]/i', '', $my_s);