I am trying to teach myself the best way to do this, but I am kind of stumped.
I have a string, for example:
$startstr="10675,g10705,4668,9983,10710,7929,g1082,10163";
What I want to do is strip out any entry prefixed with a "g" and ending with the subsequent comma and put it in a new string.
For instance:
$newstring1="10675,4668,9983,10710,7929,10163";
would have all the entries stripped out, and another string:
$newstring2="g10705,g1082";
would have just the "g" related entries.
I know this is kind of trivial, but I have been playing around with preg_replace and preg_match_all and I can't get them to work out as I thought they would.
Thanks in advance for any help!!!