I'm using strlen() to count the number of chars in a text, but it even counts newline \n. Can i replace newlines is some way to make strlen() don't count them?
Asked
Active
Viewed 2,924 times
1
-
1Considere adding code to your question ;) For your problem, you could copy your string to a temporary one, strip the newlines from it then count the number of char in this temporary string – Veve Nov 22 '14 at 17:41
-
1`strlen(str_replace("\n", "", $str));` – DarkBee Nov 22 '14 at 17:45