0

I have a simple PHP code. And I use "PHP designer" software as editor. My problem is in the editor itself , and the texts in editor changed to ascii codes ! (I don't know but I think it is ascii)

The language of texts is arabic but after I saved it and close the editor. all of the arabic words in my php file changed to codes. Here is part of my codes.

<?php
    if (condition)
        {
         if (mysqli_num_rows($result) > 0)
               {
                   echo '&#1593;&#1605;&#1604;&#1740;&#1575;&#1578;';
                   exit();
               }
        }
?>

All I want is change this codes to arabic words. I tried to open this file with Dream Weaver and Notepad++ but in this editors the arabic words changed to ascii codes too.

Is there any way to solve this problem ?

iman_sh
  • 420
  • 1
  • 8
  • 22

3 Answers3

1

html_entity_decode() will translate the entities back into their UTF8 representation, eg:

var_dump(html_entity_decode('&#1593;&#1605;&#1604;&#1740;&#1575;&#1578;'));

Result:

string(12) "عملیات"

But you're going to have to review your editor's documentation on how to get it to stop doing that in the first place, which is the true answer here.

Also, this is required reading: UTF-8 all the way through

Sammitch
  • 30,782
  • 7
  • 50
  • 77
0

can solve tow way 1-change IDE to IDE support ARABIC like Geany, VB code

or

2-save all coed in unicode

Eng.Alserhany
  • 43
  • 1
  • 4
  • Thanks for your answer , how can i save it in unicode ? notepad++ can do that ? how ? @Eng.Alserhany – iman_sh Dec 28 '18 at 21:23
0

My problem solved with an online text converter.

This web site can change ascii codes to utf-8 or any text encodes.

iman_sh
  • 420
  • 1
  • 8
  • 22