flemingmike Posted September 28, 2010 Share Posted September 28, 2010 hello, is it possible to get the 1274 out of the following? $jobnumber='1009-1274R'; $shortnumber= (this is where i need it to be 1274); Link to comment https://forums.phpfreaks.com/topic/214568-shorten-a-string/ Share on other sites More sharing options...
flemingmike Posted September 28, 2010 Author Share Posted September 28, 2010 is this possible? Link to comment https://forums.phpfreaks.com/topic/214568-shorten-a-string/#findComment-1116573 Share on other sites More sharing options...
flemingmike Posted September 28, 2010 Author Share Posted September 28, 2010 here is what i have. i cant get rid of the last character though $jobid='1009-1274R'; $shortid=substr($jobid, 5); echo "$shortid"; Link to comment https://forums.phpfreaks.com/topic/214568-shorten-a-string/#findComment-1116587 Share on other sites More sharing options...
Pikachu2000 Posted September 28, 2010 Share Posted September 28, 2010 You got really close $shortid=substr($jobid, 5, -1); Link to comment https://forums.phpfreaks.com/topic/214568-shorten-a-string/#findComment-1116590 Share on other sites More sharing options...
flemingmike Posted September 28, 2010 Author Share Posted September 28, 2010 thanks man, you have been my savior lately. Link to comment https://forums.phpfreaks.com/topic/214568-shorten-a-string/#findComment-1116593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.