How do I read a quot;,quot; as quot;lt;br /gt;quot; in PHP/MySQL?(如何阅读“,?作为“lt;br/gt;在 PHP/MySQL 中?)
问题描述
所以我有这个 MySQL 数据库和一个表,并且在行中有很多,",我希望当它们在屏幕上输出时用 PHP 切换到
"而不是昏迷,我该怎么做?
So I have this MySQL database and a table and in the rows there a lot of "," in them, and I wish when they are output on the screen with PHP to be switched to "
" instead of coma, how do I do that?
我的意思是,这是一个例子,它是这样的:你好,不,谢谢,而不是像这样输出,我希望它输出为:你好不谢谢
I mean, this is a example, it stands like this: hello,no,thanks and instead of being output like that I would like it to be output as: hello no thanks
我该怎么做?有人可以为我做吗?会很友好.
How do I do that? Could someone do it for me? Would be very friendly.
推荐答案
假设没有 CSV 引用问题:
Assuming there are no CSV quoting issues:
$newStr = str_replace( ',', '<br>', $string );
看到您的回滚后,我发现您实际上想将 ,
替换为 newline
字符,例如
,
或
:
After seeing your rollback, i see that you actually want to replace the ,
with a newline
character such as
,
or
:
$newStr = str_replace( ',', "
", $string );
这篇关于如何阅读“,"?作为“<br/>"在 PHP/MySQL 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何阅读“,"?作为“<br/>"在 PHP/MySQL 中?


基础教程推荐
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01