raimis100 Posted March 26, 2008 Share Posted March 26, 2008 I need function which could remove characters from one position to another! Can any1 suggest what functions to use couse I have been searching for a 20 min and cant find any! For example My string is $name = 'Name' What function should I use to just delete part 'me' Link to comment https://forums.phpfreaks.com/topic/97994-function-for-deleting-chars-in-string/ Share on other sites More sharing options...
trq Posted March 26, 2008 Share Posted March 26, 2008 <?php echo str_replace('me','','Name'); ?> If you want to remove things via position, you'll want to look into substr(). Link to comment https://forums.phpfreaks.com/topic/97994-function-for-deleting-chars-in-string/#findComment-501375 Share on other sites More sharing options...
raimis100 Posted March 26, 2008 Author Share Posted March 26, 2008 Yea , for that I could , but I need to delete characters from a middle ! Ofcorse I could use substr from both sides and then stick together those 2 but it takes much writing ; So there is no already write function to do it ? Link to comment https://forums.phpfreaks.com/topic/97994-function-for-deleting-chars-in-string/#findComment-501382 Share on other sites More sharing options...
trq Posted March 26, 2008 Share Posted March 26, 2008 So there is no already write function to do it ? Yes, substr. Sometimes you need to work for your money Link to comment https://forums.phpfreaks.com/topic/97994-function-for-deleting-chars-in-string/#findComment-501392 Share on other sites More sharing options...
raimis100 Posted March 26, 2008 Author Share Posted March 26, 2008 Lol ; really hope you are not lying and this will pay back Thnx for replay Link to comment https://forums.phpfreaks.com/topic/97994-function-for-deleting-chars-in-string/#findComment-501397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.