Bogdan Ungureanu
Random things about PHP and sometimes TypeScript
about
A random software engineer from Romania.
Software Engineer @ Automattic
Category: PHP
-
PHP Intl now contains a new class that allows us to display arrays as locale-aware string lists – IntlListFormatter. The purpose of it is relatively simple since it’s just a wrapper for ICU’s ListFormatter: take an array, pass a locale and display it as a string. There are two optional parameters: conjunction type and width.…
-
I was working recently on a small feature that needed to output numbers like 1200 to a short compact version like 1.2k. Simple right? I can just make a function or use ChatGPT to generate one for me: Task done. Except… It’s not-so-straightforward if you need the value to be locale aware. For starters, the…