删除字符串开头和结尾的双引号 [英] Removing double quotes from beginning and end of String

查看:1165
本文介绍了删除字符串开头和结尾的双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找出的是哪个php函数允许我删除文本字符串开头和结尾的双引号(如果存在的话)

What I'm trying to find out is which php function allows me to remove double quotes from the beginning and end of a text string if they exist

推荐答案

使用 trim 函数:

$str = '"Hello"';
echo trim($str, '"'); // Outputs Hello

这篇关于删除字符串开头和结尾的双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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