Archive

All articles

51 articles, page 4 of 6

Bash

strlen() in Bash: Get the Length of a String

Bash's ${#var} counts characters, PHP's strlen() counts bytes. A clean strlen() function, a strbytes() companion, and the locale traps in between.

6 min read, updated 17 Oct 2026