orchet7 Posted August 31, 2011 Share Posted August 31, 2011 ok i have php site which is utf-8. and it all displays ČĆŠĐŽ good. but the script i use is (the script is simple .txt file) displaying Ć as Ć and ČŠĐŽ as similar symbols.. now i've been told that i have to put attached code somewhere inside .php file, but no matter where i put it, it wont read Ć as Ć but Ć.. PLEASE HELP! <?php $ent = array( 'Ć'=>'Ć', 'ć'=>'ć', 'Č'=>'Č', 'č'=>'č', 'Đ'=>'Đ', 'đ'=>'đ', 'Š'=>'Š', 'š'=>'š', 'Ž'=>'Ž', 'ž'=>'ž' ); echo strtr('ĆćČčĐ𩹮ž', $ent); ?> Quote Link to comment https://forums.phpfreaks.com/topic/246143-help-with-entities/ Share on other sites More sharing options...
WebStyles Posted August 31, 2011 Share Posted August 31, 2011 That code gives me the following output: ĆćČčĐ𩹮ž (printed on screen) ĆćČčĐ𩹮ž (source view) So it seems its working. your problem must be somewhere else. Quote Link to comment https://forums.phpfreaks.com/topic/246143-help-with-entities/#findComment-1264087 Share on other sites More sharing options...
orchet7 Posted August 31, 2011 Author Share Posted August 31, 2011 That code gives me the following output: ĆćČčĐ𩹮ž (printed on screen) ĆćČčĐ𩹮ž (source view) So it seems its working. your problem must be somewhere else. no, the database .txt file displays ĆćČčĐ𩹮ž. what i want from php is to convert that symbols back to ČĆŠĐŽ .. got me? Quote Link to comment https://forums.phpfreaks.com/topic/246143-help-with-entities/#findComment-1264090 Share on other sites More sharing options...
WebStyles Posted August 31, 2011 Share Posted August 31, 2011 then switch the array around.. instead of: $ent = array( 'Ć'=>'Ć', do this: $ent = array( 'Ć'=>'Ć', Quote Link to comment https://forums.phpfreaks.com/topic/246143-help-with-entities/#findComment-1264094 Share on other sites More sharing options...
orchet7 Posted August 31, 2011 Author Share Posted August 31, 2011 then switch the array around.. instead of: $ent = array( 'Ć'=>'Ć', do this: $ent = array( 'Ć'=>'Ć', thank you, but as i'm NOOB with PHP... where to put this code exactly inside .php file? Quote Link to comment https://forums.phpfreaks.com/topic/246143-help-with-entities/#findComment-1264099 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.