hi have string,
$rt="Ability: B,Session: Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time: 9:30am,karthi";
$rt="Ability: B,Session: Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time: 9:30pm,karthi";
i used below regex for remove text from last comma(,).
$it_nme = preg_replace('/(?<=pm,)\S*/is', '', $rt);
it is worked for second string (because before comma have 'pm' text). for second one before comma we have string 'am'.
for both how can i write single regex?