Hướng dẫn php substr japanese characters
i'm echoing japanese characters fine but when i try to substr and echo out part of the string it just turn to question marks ��� Show note: i set my header to utf-8
and made the meta
asked Jul 31, 2012 at 10:17
1 When working with your multibyte strings, you'll need to use the answered Jul 31, 2012 at 10:18
Michael RobinsonMichael Robinson 28.7k12 gold badges103 silver badges129 bronze badges 2 Try multibyte substrings, mb_substr() info found here This function is made for characters not in the english ascii code set. answered Jul 31, 2012 at 10:19
will work. But, remember to add the following line at the top of your script:
answered Jan 7, 2015 at 5:10
oabarcaoabarca 10.4k6 gold badges56 silver badges70 bronze badges Not the answer you're looking for? Browse other questions tagged php utf-8 character-encoding or ask your own question.(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8) mb_substr — Get part of string Descriptionmb_substr( Parametersstring The string to extract the substring from. start If If length Maximum number of characters to use from encoding The Return Values mb_substr() returns the portion of Changelog
See Also
qbolec at gmail dot com ¶ 7 years ago
xiaogil at yahoo dot fr ¶ 17 years ago
drraf at tlen dot pl ¶ 17 years ago
( substr( 'abc', 5, 2 ) ); // returns "false" desmatic at gmail dot com ¶ 9 years ago
$has; p dot assenov at aip-solutions dot com ¶ 10 years ago
qdinar at gmail dot com ¶ 6 years ago
('Content-Type: text/html; charset=utf-8'); sanjuro at 1up-games dot com ¶ 8 years ago
("ISO-8859-1"); echo mb_internal_encoding(),"\n projektas at gmail dot com ¶ 13 years ago
$_POST['check']) && !empty($_POST['check'])) { |