例如我有文件 config.php:
$host = 'localhost';
$db = 'logger';
$user = 'user';
$pwd = 'pass';
Run Code Online (Sandbox Code Playgroud)
和文件 mysqlClass.php
class mysql{
public function connect(){
//hot get get variables form confing.php there ?
}
}
Run Code Online (Sandbox Code Playgroud)
而且我不知道从 mysql 类中的 confin.php 获取变量的热度,我无法更改 config.php 文件
我有标题:
header('Content-Type: text/html; charset=UTF-8');
header("Content-type: application/octetstream");
header('Content-Disposition: attachment; filename="export.csv"');
Run Code Online (Sandbox Code Playgroud)
但如果我"Pagrindin?"在excel show 中的数据库中有单词,解码不能正常工作"PagrindinÄ",我的标题出了 什么问题?
我有字符串
10.2,200.3,33.00
我希望它被替换为
10,2,200,3,33,00
我试过了
preg_replace("/[.]$/","/\d[,]$/",$input);
但它没有取代!
我无法使用,str_replace因为这是大学的任务