小编Sef*_*ean的帖子

在calc(css)中使用screen.width

在calc中是否有使用scree.width?像这样的东西:

left: calc(250px + screen.width - 1024px)!important;
Run Code Online (Sandbox Code Playgroud)

是针对具体情况,@ media(max-width:1024px)不起作用.

css screen calc width

21
推荐指数
2
解决办法
2万
查看次数

使用 fputcsv php 在 csv 上添加标题

我正在尝试将一些数据输入到一个 csv 文件中并且它运行良好,但是如果我尝试添加数据表的标题,Excel 将不会让我打开该文件,因为“文件格式和扩展名。 csv 不匹配。文件可能已损坏或不安全”。

这是代码:

//crate headers
$headers[] = "ID";
$headers[] = "Name";
$headers[] = "Ref";
$headers[] = "Quantity";

// crete and open file  
$csvName = "file.csv";
$fileHandle = fopen($csvName, 'w') or die('Can\'t create .csv file, try again later.');

//Add the headers, if I take this line out the excel allows me to open the file
fputcsv($fileHandle,$headers,";");

//Add the data
for($i = 0; $i < count($info); ++$i) {
    fputcsv($fileHandle,$info[$i],";");
}

//close file
fclose($fileHandle);
Run Code Online (Sandbox Code Playgroud)

编辑:

这是我用记事本打开的 csv 的第一行:

ID;名称;参考;数量 …

php csv fputcsv

1
推荐指数
1
解决办法
4453
查看次数

标签 统计

calc ×1

css ×1

csv ×1

fputcsv ×1

php ×1

screen ×1

width ×1