- Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- I Want TO Convert This String TO THE Following
<?php
$string = "i want to convert this string to the following";
echo preg_replace_callback('/\b\w(?:\w{1,2}\b)?/', fn($m) => strtoupper($m[0]), $string);