returning a string up to a certain character.
Posted: Fri Sep 27, 2002 12:29 pm
Hello again forum,
Most of those String manipulation functions in the manual are confusing the mess outta me.
what i'm trying to do is simply take a string and extract the begining part of that string out, up to a certian character "(".
i've tried a number of the functions and have been able to get everything after the "(" but not before..
currently i'm battling the preg_split() function becuase i think i'll be able to actually use more than just one part of the string..
Here is what i'm trying to do specifically....
take..
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
and extract up to the first "(" and keep everything before and after that.. then take everything after the "(" and split it by the ";" and stor all the data in an array(i'm guessing that's the best way). please help..
the main reason that the manual confuses me so much is because most of the examples are using special characters and use so many escapes (that i don't totally understand) that it clouds up the example with extra characters that (i don't think) need to be there to get the point of the function across...
sheesh.. i need some more coffee..
any help is greatly appreciated..
Thanks
Will
Most of those String manipulation functions in the manual are confusing the mess outta me.
what i'm trying to do is simply take a string and extract the begining part of that string out, up to a certian character "(".
i've tried a number of the functions and have been able to get everything after the "(" but not before..
currently i'm battling the preg_split() function becuase i think i'll be able to actually use more than just one part of the string..
Here is what i'm trying to do specifically....
take..
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
and extract up to the first "(" and keep everything before and after that.. then take everything after the "(" and split it by the ";" and stor all the data in an array(i'm guessing that's the best way). please help..
the main reason that the manual confuses me so much is because most of the examples are using special characters and use so many escapes (that i don't totally understand) that it clouds up the example with extra characters that (i don't think) need to be there to get the point of the function across...
sheesh.. i need some more coffee..
any help is greatly appreciated..
Thanks
Will