当前位置: 动力学知识库 > 问答 > 编程问答 >

how to remove single quotes and comma in single trim function in php

问题描述:

I need to remove single quotes and comma in single trim() function in PHP.

For example see the below code:

$Myvariable1 = rtrim($Myvariable,"'");

rtrim($Myvariable1,",");

The first line I am using "rtrim" to remove the single quote and in the second line again i am using "rtrim" to remove the comma.

Can we use the single trim function to remove both the single quote and comma?

网友答案:

Not the answer you were looking for with rtrim, but achieves the same thing.

str_replace("'",'',str_replace(',','',$string));
分享给朋友:
您可能感兴趣的文章:
随机阅读: