使用PHP在CSV文件中写逗号 [英] Write a comma in a CSV File with PHP

查看:346
本文介绍了使用PHP在CSV文件中写逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发送一个csv文件作为标题,我想使用逗号(不是分开,只是使用)。我怎么会这样做?
我使用PHP,我不能使用 fputcsv ,因为我把它作为一个头。

只要使用''。$ value。''就可以了。


i am sending a csv file as a header and i want to use a comma (not to seperate, just to use). how would i do that? i'm using PHP and i can not use fputcsv because i'm sending it as a header.

解决方案

Just use '"'.$value.'"' around it and it will be fine.

这篇关于使用PHP在CSV文件中写逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆