9three Posted June 19, 2009 Share Posted June 19, 2009 Hey, does anyone know a way to grab a part of a string or integer? $string = 'Hello World!'; $int = 123456789; The tricky part is that the string we always be different as well as the int. I want to pull the last 4 of that integer (6789) or the last 4 of that string (rld!) I'm not sure if there is a function for this? Link to comment https://forums.phpfreaks.com/topic/162907-solved-grabbing-part-of-a-stringinteger/ Share on other sites More sharing options...
GingerRobot Posted June 19, 2009 Share Posted June 19, 2009 If you just want to get the last 4 characters, use substr Link to comment https://forums.phpfreaks.com/topic/162907-solved-grabbing-part-of-a-stringinteger/#findComment-859558 Share on other sites More sharing options...
9three Posted June 19, 2009 Author Share Posted June 19, 2009 ah yes thank you! Link to comment https://forums.phpfreaks.com/topic/162907-solved-grabbing-part-of-a-stringinteger/#findComment-859561 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.