#utf-8 Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
PHP URL Slug Generator (UTF-8 safe)
Convert any string into a clean URL-safe slug. Transliterates accented characters to ASCII, lowercases, replaces non-alphanumerics with dashes, and collapses runs of dashes. Works on UTF-8 input out of the box.
PHP Truncate Text with Ellipsis (word-safe)
Cleanly truncate a string to a max length without breaking words mid-character. Adds a trailing ellipsis when truncated and never exceeds the requested length including the ellipsis.
PHP Detect & Strip Byte Order Mark
Some text editors prepend a UTF-8 BOM (0xEF 0xBB 0xBF) which breaks header() calls, JSON, and PHP output. Detect and strip it defensively when ingesting external files.
PHP Word Count (UTF-8 aware)
Count words in a string in a way that works for any Unicode script — including those without ASCII whitespace. Built on the \p{L}\p{N} Unicode regex categories.
PHP UTF-8 Safe substr / strlen
Wrap mb_* with sensible defaults so you stop accidentally chopping multi-byte characters in half. Defensive helpers for projects where input is not guaranteed ASCII.