stripping sections of a string out...
Posted: Fri Jun 06, 2008 9:35 am
Blah, when it comes to regular expressions i'm completely lost.
$value = "CN0G554F641808470REL"
$value is in a loop so the string itself changes frequently, except for the length. $value will always contain 20 characters.
What i'd like to do is have a new variable:
$value2 = "G554F8470REL"
What needs to be done is stripping the first 3 characters, keeping the next 5, stripping the next 5 then keeping the rest.
Something like CN0G554F641808470REL stripping out the colored text.
I have no idea where to begin.
$value = "CN0G554F641808470REL"
$value is in a loop so the string itself changes frequently, except for the length. $value will always contain 20 characters.
What i'd like to do is have a new variable:
$value2 = "G554F8470REL"
What needs to be done is stripping the first 3 characters, keeping the next 5, stripping the next 5 then keeping the rest.
Something like CN0G554F641808470REL stripping out the colored text.
I have no idea where to begin.