Samuel Loog Samuel Loog - 2 months ago 11
PHP Question

How convert specific number symbols to number

i have some string with next symbols: '14'. How i can convert this to integer?

print_r((int)'14'); // 0

Answer

You can use the function mb_convert_kana to convert full-width unicode characters

$str = '14';
echo (int) mb_convert_kana($str, 'n');
// 14
Comments