hi everyone. im a newbie to the site and have a question:
does anyone know how to take data from a form and use only a certain portion of it.
Example, lets say someone enters 19 characters: "9885746234567891234" but I only want to use a certain portion of that. Lets say I only want to use "623456789" which is from the original string. So to sum it up, I want to skip the first six characters, use the next nine characters, and skip the last 4 characters.
Any help is greatly appreciated!
-Daniel
strip data
Moderator: General Moderators
Re: strip data
Something very similar to this should do the trick:
This link has all the documentation you'd ever want on the subject:
http://ca3.php.net/manual/en/function.substr.php
Code: Select all
$string = '9885746234567891234';
$subString = substr($string, 5, 9);
print $subString;
http://ca3.php.net/manual/en/function.substr.php