d22552000 Posted August 12, 2007 Share Posted August 12, 2007 How do I take a string... say: "5 + 5 + 5 +" and take off the last two charcters... so the outcome would be "5 + 5 + 5" Link to comment https://forums.phpfreaks.com/topic/64566-how-make-string-2char-shorter/ Share on other sites More sharing options...
Orio Posted August 12, 2007 Share Posted August 12, 2007 Use substr(): <?php substr($str, 0, -2); ?> Orio. Link to comment https://forums.phpfreaks.com/topic/64566-how-make-string-2char-shorter/#findComment-321838 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.