Here is the code:
$string = "/My-Item-Here-p/sb-p36abbg.htm";
$str = preg_replace('/^.*-p\s*/', '', $string);
$str = substr($str, 1);
echo $str;
This spits out 6abbg.htm, I would like to have it to only remove everything before and including the "-p/" (note with forward slash).
So I would like it to spit out sb-p36abbg.htm
echo basename($string);-p/in the source string? Do you want to keep the smallest or the bigger substring?-p/