<?php
$string = 'goofe eas تان ک'.chr( bindec( '11111100' ) ).'ے عسکری ذرائع کے مطابق بدھ' .chr( bindec( '11011111' ) );
echo iconv_substr( $string , 6 , null , 'utf-8' )."\n";
echo iconv_substr( $string , 6 , 4 , 'utf-8' )."\n";
echo iconv_substr( $string , 6 , -4 , 'utf-8' )."\n";
echo iconv_substr( $string , -4 , null , 'utf-8' )."\n";
echo "After setting internal encoding\n";
iconv_set_encoding("internal_encoding", "UTF-8");
echo iconv_substr( $string , 6 )."\n";
echo iconv_substr( $string , 6 , 4 )."\n";
echo iconv_substr( $string , 6 , -4 )."\n";
echo iconv_substr( $string , -4 )."\n";
exit(0);
preferences:
39.67 ms | 402 KiB | 5 Q