How to get substring with multibyte string function in PHP

1 Answer

0 votes
$s = "programming php";

echo mb_strimwidth($s, 0, 6) . "\n";
echo mb_strimwidth($s, 0, 4) . "\n";
echo mb_strimwidth($s, 0, 8);





/*
run:

progra
prog
programm

*/

 



answered Jun 23, 2021 by avibootz
...