Леший Posted September 15, 2010 Report Share Posted September 15, 2010 Principā, subj. Vajag atrast iespēju sadalīt string pēc patterna tā, lai UFT8 simboli paliktu neizkropļoti. Quote Link to comment Share on other sites More sharing options...
indoom Posted September 15, 2010 Report Share Posted September 15, 2010 mb_split Quote Link to comment Share on other sites More sharing options...
codez Posted September 15, 2010 Report Share Posted September 15, 2010 ieliec modifaijeri '//u' un vajadzētu strādāt Quote Link to comment Share on other sites More sharing options...
Леший Posted September 15, 2010 Author Report Share Posted September 15, 2010 Abi varianti izprovēti reizes 100, nepalīdzēja. Quote Link to comment Share on other sites More sharing options...
codez Posted September 15, 2010 Report Share Posted September 15, 2010 varbūt iemet, kāds tieši variants nestrādā. Quote Link to comment Share on other sites More sharing options...
Леший Posted September 15, 2010 Author Report Share Posted September 15, 2010 (edited) $source = "Šodien ir siltā diena, rīt būs siltāk."; $source_arr = preg_split('/ /', $source, -1, PREG_SPLIT_NO_EMPTY); var_dump($source_arr); $source_arr = preg_split('/ /u', $source, -1, PREG_SPLIT_NO_EMPTY); var_dump($source_arr); array(7) { [0]=> string(6) "�odien" [1]=> string(2) "ir" [2]=> string(5) "silt?" [3]=> string(6) "diena," [4]=> string(3) "r?t" [5]=> string(3) "b?s" [6]=> string(7) "silt?k." } array(1) { [0]=> string(38) "�odien ir silt? diena, r?t b?s silt?k." } mb_split() izdod tādus pašus rezultātus. Edited September 15, 2010 by Леший Quote Link to comment Share on other sites More sharing options...
indoom Posted September 15, 2010 Report Share Posted September 15, 2010 pamēģini norādīt mb_internal_encoding('UTF-8'); Quote Link to comment Share on other sites More sharing options...
codez Posted September 15, 2010 Report Share Posted September 15, 2010 man strādā, varbūt aizmirsi šo: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Quote Link to comment Share on other sites More sharing options...
Леший Posted September 15, 2010 Author Report Share Posted September 15, 2010 codez, paldies, encoding man bija norādīts, bet nepareizā vietā laidu var_dump, pirms visa outputa sūtīšanas. 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.