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

防止或编码'到'[复制]

This question already has an answer here:

  • How to replace Microsoft-encoded quotes in PHP 6 answers

I had an issue. I do not want to insert ’ to the database.

Because when reading the ’ it will turn out with funny character.

Is there a way to prevent or encode ’ to ' when inserting to MySQL?

</div>

If you just want to replace that specific string why not just doing:

$encoded = str_repace("’","'",$input);

近期文章

  • 插入查询以在php和Mysql中存储全局站点首选项
  • Wordpress中的数组?
  • PHP和MySql - 比较日期[重复]
  • Mac上的Apache,MySql,dan PHP
  • 如何与PHP和JAVA进行通信
  • 是否可以使用google admin sdk通过API设置用户的群组电子邮件通知设置?
  • 如何在Silverstripe用户表单模块中的FileFields中验证上载的文件大小
  • 从MySQL表显示行时出错
  • 在数据库结构中选择表
  • PHP中的实时服务器不支持文件类型函数
  • $ this-> Paginator-> sort不适用于cakephp 3中的数字
  • 为MySQL中的所有记录组选择一组记录中的特定记录
  • PHP异常处理 - 错误没有被捕获
  • 我的分类 - $ taxonomy.php页面帖子没有显示?
  • 注册和登录
  • 用PHP手动计算两个日期之间的周数
  • XAMPP可以通过localhost:8080连接,但不能通过IP地址/ 127.0.0.1连接
  • 使用名称或用户名Laravel 5.2进行验证[关闭]
  • 日期不会写在我的数据库中
  • 如何从Ubuntu服务器启动php站点

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华