问题描述:

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));
相关阅读:
Top