We Must Design Posted July 20, 2007 Share Posted July 20, 2007 I am wanting to remove the last character of a string, for example I want to change: 1|2|3|4| to 1|2|3|4 Could I get php to automatically remove this last character? Any guidence appreciated! Link to comment https://forums.phpfreaks.com/topic/60951-solved-remove-last-character-in-string/ Share on other sites More sharing options...
hvle Posted July 20, 2007 Share Posted July 20, 2007 $str = substr($str,0,(strlen($str)-1)); Link to comment https://forums.phpfreaks.com/topic/60951-solved-remove-last-character-in-string/#findComment-303275 Share on other sites More sharing options...
We Must Design Posted July 20, 2007 Author Share Posted July 20, 2007 Thankyou for your reply, I will try this now Link to comment https://forums.phpfreaks.com/topic/60951-solved-remove-last-character-in-string/#findComment-303281 Share on other sites More sharing options...
We Must Design Posted July 20, 2007 Author Share Posted July 20, 2007 worked a treat, thanks again! Link to comment https://forums.phpfreaks.com/topic/60951-solved-remove-last-character-in-string/#findComment-303347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.