Jump to content

Help with entities


orchet7

Recommended Posts

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(

    'Ć'=>'&#262;',

    'ć'=>'&#263;',

    'Č'=>'&#268;',

    'č'=>'&#269;',

    'Đ'=>'&#272',

    'đ'=>'&#273',

    'Š'=>'&#352',

    'š'=>'&#353',

    'Ž'=>'&#381',

    'ž'=>'&#382'

);

 

echo strtr('ĆćČčĐ𩹮ž', $ent);

?>

 

Link to comment
https://forums.phpfreaks.com/topic/246143-help-with-entities/
Share on other sites

That code gives me the following output:

 

ĆćČčĐ𩹮ž (printed on screen)

 

&#262;&#263;&#268;&#269;&#272&#273&#352&#353&#381&#382 (source view)

 

So it seems its working. your problem must be somewhere else.

no, the database .txt file displays

&#262;&#263;&#268;&#269;&#272&#273&#352&#353&#381&#382. 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.