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); ?> 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. 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? 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( 'Ć'=>'Ć', 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? Link to comment https://forums.phpfreaks.com/topic/246143-help-with-entities/#findComment-1264099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.