i add this define()
function in my config.php
file.
$options = DataAccess::FETCHLOAD("SELECT sign FROM " . OPTIONS . " WHERE 1");
define('_SIGN_',$options['0']['sign']);
Now, i required
config.php
file into my index.php
page like this :
require $abspath .'/config.php';
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?PHP echo _SIGN_; ?>
</body>
</html>
now in output i have this result:
?????????????????????
worked result :
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
$options = DataAccess::FETCHLOAD("SELECT sign FROM " . OPTIONS . " WHERE 1");
define('_SIGN_',$options['0']['sign']);
<?PHP echo _SIGN_; ?>
</body>
</html>
output result :
تواصل معنا
how do fix this for show unicode UTF-8 when i required config.php
?!
Did you try after establishing connection to the database execute:
set_charset ( "utf8")
I use MySQLi and make it this way:
Fist where did you set the variable
$abspath
?Then you have to put
<?php
and?>
tags around your require statemet and in your config file around your php!Now the example below works fine for me and is pretty much the same as yours!
config.php:
index.php:
And the Output is: