cipcaps Posted September 5, 2010 Report Share Posted September 5, 2010 Lieta tāda ka ņemos jau kādu laiku ar to un nekas neiet. Datubāzē ir lauks ar tekstu "Kāda mūsu fane", caur phpMyAdmin izskatās šādi "KÄda mÅ«su fane" Bet kad lietoju šādu kodu $res = mysql_query("SELECT * FROM `table` WHERE `id` = 'info' ORDER BY `id` DESC"); while($arr = mysql_fetch_array($res)){ echo $arr['text']; } tiek parādīts skaisti "Kāda mūsu fane", bet ja vajag piem. nosaukumu kas ierobežo garumu, šādi $res = mysql_query("SELECT * FROM `table` WHERE `id` = 'info' ORDER BY `id` DESC"); while($arr = mysql_fetch_array($res)){ echo substr($arr['text'],0,7); } tad ir tā "Kāda m", jo cik saprotu tad viņš lieto "KÄda mÅ", bet kā lai dabūt to ka viņš "Å«" uzskata par "ū" pirms paņem pirmos septiņus simbolus? PALDIES. Quote Link to comment Share on other sites More sharing options...
101111 Posted September 5, 2010 Report Share Posted September 5, 2010 mb_substr($arr['text'],0,7,'UTF-8') Quote Link to comment Share on other sites More sharing options...
cipcaps Posted September 5, 2010 Author Report Share Posted September 5, 2010 Iet. Paldies. Super. Tagad zināšu. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.