sandy1028 Posted October 13, 2009 Share Posted October 13, 2009 HI, How to delete "," at the end of the string. $match = 2009/02/03/a2correx03cvbnm, echo preg_replace("/;$/", "HI", "$match"); Link to comment https://forums.phpfreaks.com/topic/177503-delete-comma/ Share on other sites More sharing options...
gizmola Posted October 13, 2009 Share Posted October 13, 2009 What does the preg_replace have to do with this? Your sample code isn't even valid. Trim will let you trim any arbitrary character you want, if you use the 2nd parameter, so ... $match = trim($match, ','); Will remove a trailing comma no problem. Link to comment https://forums.phpfreaks.com/topic/177503-delete-comma/#findComment-935893 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.