我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Laravel替换数据库中的Unicode字符

I stored some hours from Google Places and little did I know it brought in some longer dashes (\u2013) and I'd like to loop through and convert anything in the database that is a unicode string into a normal string, as when I retrieve these hours I can't explode them via

explode(' - ', $hours);

What's the best way to do this in Laravel/MySQL/PHP?

You can use an SQL query for that:

UPDATE `table`
SET `column`=REPLACE(`column`, '–', '-')

近期文章

  • php $ _POST不起作用,我得到空结果
  • php类中的WordPress主题激活挂钩
  • 给出未在源代码中设置的链接的运行时href
  • 确认代码页无需输入即自动验证
  • 如何将信息插入Order-OrderProduct表MySQL Laravel
  • 无法使用表单在数据库中插入值
  • 字段没有默认值。 添加“朋友”
  • 单击div时如何设置$ _SESSION变量
  • 如何在条件内从循环中打印一条消息?
  • 获取错误:PHP致命错误:不支持的操作数类型
  • 循环遍历嵌套数组PHP
  • 在prestashop中创建url重写模块
  • 在不使用codeigniter中的查询构建器的情况下总计总计
  • 当页面不存在时,如何重定向到404.php?
  • 如何纠正将php变量传递给ajax调用?
  • 使用@extend布局的Laravel问题
  • 如何在第一组之前使正则表达式匹配
  • 使用htaccess禁用文件夹或子文件夹,并在重定向时使用自定义页面
  • 在laravel中搜索列名以获取行
  • Laravel:有没有办法重用一个使用Request变量作为参数的方法?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华