I have a randomly generated string that I want to be able to trim. What I want is to keep the first 6 characters and trim off anything to the right.
Here's an example:
I want to take this J702U8.5A and make it this J702U8
I don't know how ... please help.
substr() ?
$yourstring = "abcdefghi";
$better_string = substr($yourstring,0,5);
and better_string will be the first 5 characters (abcde) 0 is the start, 5 is the length of the string you will return.
check it out on php.net ... it explains it pretty well
sm
Thanks ... that worked stupendously!