Four ways to count to four: PHP strings, iconv, mbstring and grapheme Nothing like starting the day with a nice café, in a Parisian café, pun intended. Now, when you ask PHP how long the word “Café” is, you get four answers from four families of functions. Two of them agree, one says 5, and […]
When PHP Reads Something Else: Visual Traps in Source Code PHP code is read by two very different audiences: human developers and the PHP parser. Humans read glyphs, the shapes our eyes recognise. The parser reads bytes or characters, raw octets encoded in a file. Most of the time these two views agree perfectly. Sometimes […]
When PHP Meet Unicode: A Tour of Identifiers Beyond ASCII Every year, like clockwork, someone rediscovers that a day is not reliably 86400 seconds long, gets righteously indignant about daylight change on Hacker News, and two hundred comments later the whole internet has relearned a lesson it relearns every March and October. PHP’s “you can […]



