0

I am implimenting language module using ini file. So i am inserting lable and its value into ini file but the values are inserting like ??? ????? in arabic language.

i have added

//in header section 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     

 //in php section 
   ini_set('default_charset','utf-8');     
    header("Content-Type: text/html; charset=UTF-8");

and also i have add the below line while making string for ini file

utf8_encode($elem);

I want to add and also update the already added ini values. please tell me how to do everything.

Thanks in advance.

pankil thakkar
  • 411
  • 1
  • 5
  • 15

1 Answers1

0

It works for me. Could you provide some code what have you tried?

t.php

$ file -bi t.php
text/html; charset=us-ascii

<?
if ($_POST && isset($_POST['t'])) {
    $h = fopen('/tmp/h.txt', 'w');
    fwrite($h, $_POST['t']);
    fclose($h);

    readfile('/tmp/h.txt');
    exit;
}

?>
<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     
    </head>
    <body>
        <form method="post">
            <input type="text" name="t">
            <input type="submit">
        </form>
    </body>
</html>

Output after Submit

enter image description here

File after submit

$ file -bi /tmp/h.txt
text/plain; charset=utf-8

And the web page and submit data

enter image description here

iiro
  • 3,132
  • 1
  • 19
  • 22