I have a variable who's value is CSPG3_PistolGrip_3inch-x-15.00-x-14.00-x-13.00-x-12.00
the "-x-" delimits prices so I've used the following code to break them up:
if(preg_match('||',$key)) {
$parts = explode('-x-',$productdetails);
for($i = 0; $i < count($parts); $i++) // we start at zero
{
$prices[] = strtr($parts[$i],'_',' '); // and clean the underscore
}
I need to have a 2nd pre_match function inside this that basically says if the variable starts with "CSPG" then do something. Would anybody know what code would I use and where would I put it?