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"); Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.