Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.