Hi i have the string like below,
$aa = "Ability: N/S,Session: Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time: 10:30am,cname: karthi";
$aa = "Ability: N/S,Session: Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time: #1 only: 1:30pm,cname: ravi";
$aa = "Ability: N/S,Session: Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time: #1 only: 1am,cname: mathi";
i need to write single regex for removing the particular string from ",cname:" upto last. i need output like,
$aa = "Ability: N/S,Session: Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time: 10:30am";
$aa = "Ability: N/S,Session: Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time: #1 only: 1:30pm";
$aa = "Ability: N/S,Session: Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time: #1 only: 1am";
how can i do this in regex?
$new = substr($str, 0, strpos($str, ',cname'));