jmhyer123 Posted March 31, 2007 Share Posted March 31, 2007 I have a form that a user enters a number into. When they submit it the script needs: 1) The Number entered 2) The first two/three numbers of the number entered depending on the length My question is: How do I/What function do I use to get the first 2/3 numbers of the entered number. I can setup the if/then statement to determine if it gets the first 2 or the first 3 numbers but what do I use to get them. I was thinking it would be explode() but there is no identifier. Anybody have any ideas. I hope this is clear enough if not let me know and I can post the script I am using. Link to comment https://forums.phpfreaks.com/topic/45053-beginner-needs-helpplease/ Share on other sites More sharing options...
AndyB Posted March 31, 2007 Share Posted March 31, 2007 http://ca.php.net/manual/en/function.substr.php and http://ca.php.net/manual/en/function.strlen.php The substring and stringlength functions. Link to comment https://forums.phpfreaks.com/topic/45053-beginner-needs-helpplease/#findComment-218721 Share on other sites More sharing options...
jmhyer123 Posted March 31, 2007 Author Share Posted March 31, 2007 Thanks i'll check those out. Worked like a charm! Thanks a ton!! Link to comment https://forums.phpfreaks.com/topic/45053-beginner-needs-helpplease/#findComment-218724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.