您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php文件中的中文乱码该怎么解决

2024/6/25 14:11:07发布19次查看
php文件中的中文乱码该如何解决
下面的文件的注释部分含有部分中文,但是乱码了。各位大神,知道该如何把乱码部分解析成中文吗?
seconds = $this->currenttime();
if ('' == $server)
{
/*****************************************************
** 
*****************************************************/
$server   = $globals['db_host'];
$username = $globals['db_user'];
$password = $globals['db_pass'];
$database = $globals['db_name'];
}
/*****************************************************
** ?
*****************************************************/
if (!$this->db = @mysql_pconnect($server, $username, $password))
{
if ($username == 'root' && $database == 'siteengine')
  {
  @header(location:/install.php);
  }
  else
  {
  $this->connectdata=false;
  //$this->error(database connect fail);
  }
}
if ($database&&$this->connectdata===true)
{
if($this->version() > '4.1')
{
global $config_charset;
$config_charset = 'utf-8';
if(!$dbcharset && in_array(strtolower($config_charset), array('gbk', 'big5', 'utf-8')))
{
$dbcharset = str_replace('-', '', $config_charset);
}
if($dbcharset)
{
mysql_query(set names '$dbcharset');
}
}
if($this->version() > '5.0.1')
{
mysql_query(set sql_mode='');
}
$this->selectdb($database);
}
return true;
}
/*****************************************************
** 
*****************************************************/
function disconnect()
{
$result = mysql_close() or $this->error();
return $result;
}
/*****************************************************
** 
*****************************************************/
function selectdb($database)
{
global $multidomain,$site_engine_root,$tablepre,$db;
if (@mysql_select_db($database, $this->db))
{
return true;
}
else
{
if ($multidomain==1)
{
$query = $this->query(create database .$database);
  @header(location:/install.php);
                // require $site_engine_root.'lib/query.php';
                // $fp = @fopen($site_engine_root.'data/sql/siteengine.sql', r);
                // [email protected]($fp, filesize($site_engine_root.'data/sql/siteengine.sql'));
                // @fclose($fp);
                // if($tablepre!='boka') $query=str_replace(boka_,$tablepre,$query);
                // $sql_query = new query($query);
                // $sql_query->doquery();
  // @header(location:/index.php);
}
  $this->error($database database connect error!);
}
}
/*****************************************************
** ?web?ус?web?·?true?·?false
*****************************************************/
function iswebenv()
{
if (isset($_server['php_self']))
{
return true;
}
if (isset($globals['_server']['php_self']))
{
return true;
}
return false;
}
/*****************************************************
** ?
*****************************************************/
function _textconvert($text)
{
if ($this->iswebenv())              // web
{
return nl2br($text);
}
return $text;
}
/*****************************************************
** ?
*****************************************************/
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product