PHP: Hypertext Preprocessor (original) (raw)
`polyfill:
str,stringstr, string str,stringencoding = null): string { if ($encoding === null) { $encoding = mb_internal_encoding(); } return mb_strtoupper(mb_substr($str, 0, 1, encoding),encoding), encoding),encoding) . mb_substr($str, 1, null, $encoding); } } ?>if you wonder why i bother with mb_internal_encoding: prior to php7, $encoding was not nullable. if your polyfill don't need php5.6 support, you can drop it.
`