eyalros Posted December 23, 2007 Share Posted December 23, 2007 Hello! I have a string like that: "XXX, XXX, XXX, " How can I remove the last ", " ? Thanks! Link to comment https://forums.phpfreaks.com/topic/82907-solved-remove-the-last-from-a-string/ Share on other sites More sharing options...
Barand Posted December 23, 2007 Share Posted December 23, 2007 www.php.net/trim Specify ", " as chars to be removed. Another method is to store the 'XXX' in an array then join(', ', $array) to eliminate the trailing comma in the first place. Link to comment https://forums.phpfreaks.com/topic/82907-solved-remove-the-last-from-a-string/#findComment-421649 Share on other sites More sharing options...
eyalros Posted December 23, 2007 Author Share Posted December 23, 2007 Thanks! Link to comment https://forums.phpfreaks.com/topic/82907-solved-remove-the-last-from-a-string/#findComment-421653 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.