dmccabe Posted March 11, 2008 Share Posted March 11, 2008 Can anyone point me in the right direction of how I can remove the last 4 characters of a string. So "filename.txt" would become "filename" Thanks! Quote Link to comment Share on other sites More sharing options...
trq Posted March 11, 2008 Share Posted March 11, 2008 substr(). Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 11, 2008 Share Posted March 11, 2008 <?php $name="redarrow.txt"; $result=substr($name,0,-4); echo $result; ?> Quote Link to comment Share on other sites More sharing options...
dmccabe Posted March 11, 2008 Author Share Posted March 11, 2008 Thank you once again good sir! 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.