CMNetworx Posted February 11, 2008 Share Posted February 11, 2008 Hello, I think this will probably be simple to someone that knows more php than myself.. I have a number, ex 354684651 I would like to strip off the first 2 characters, What would be the best way to go about this? Link to comment https://forums.phpfreaks.com/topic/90429-strip-first-2-characters/ Share on other sites More sharing options...
trq Posted February 11, 2008 Share Posted February 11, 2008 If it truely is a number then... <?php $n = 354684651; echo $n - 350000000; ?> otherwise.... <?php echo substr('354684651',1); ?> Link to comment https://forums.phpfreaks.com/topic/90429-strip-first-2-characters/#findComment-463600 Share on other sites More sharing options...
CMNetworx Posted February 11, 2008 Author Share Posted February 11, 2008 It is a number, and the first 2 digits are almost always the same, but I think I will use the substr, just to make sure I don't encounter a math mistake if I tell it to subtract the wrong number.. Thanks Link to comment https://forums.phpfreaks.com/topic/90429-strip-first-2-characters/#findComment-463610 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.