ukferret Posted April 17, 2007 Share Posted April 17, 2007 I am looking to delete the first 240 charcters from a string, anyone have any ideas how I would do this? and would I include white spaces or not? Link to comment https://forums.phpfreaks.com/topic/47326-solved-chopping-characters-from-a-string-help/ Share on other sites More sharing options...
pro_se Posted April 17, 2007 Share Posted April 17, 2007 <?php $string = "String Here... " echo substr($string, 240); ?> Try that out and tell me if it works.. Link to comment https://forums.phpfreaks.com/topic/47326-solved-chopping-characters-from-a-string-help/#findComment-230859 Share on other sites More sharing options...
ukferret Posted April 17, 2007 Author Share Posted April 17, 2007 This is the code in my script and it deos not remove the forst or last 2092 characters! got any ideas? <?php substr($file, 2092); echo $file; ?> Link to comment https://forums.phpfreaks.com/topic/47326-solved-chopping-characters-from-a-string-help/#findComment-230863 Share on other sites More sharing options...
pro_se Posted April 17, 2007 Share Posted April 17, 2007 well, <?php $file = "something.txt" echo substr($file, 2092); ?> Link to comment https://forums.phpfreaks.com/topic/47326-solved-chopping-characters-from-a-string-help/#findComment-230866 Share on other sites More sharing options...
ukferret Posted April 17, 2007 Author Share Posted April 17, 2007 I got around it by doing as you first suggested and echo'ing off that line instead of doing it seperatly and it works great cheers, oh and you do have to include white spaces echo substr($file, 2333); Many thanks. Link to comment https://forums.phpfreaks.com/topic/47326-solved-chopping-characters-from-a-string-help/#findComment-230867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.