<?php $recipients = "john('john@yahoo.com'), frank('frank@gmail.com'),simon('simon@to.com')"; preg_match_all("/(?:, ?)?([^(]+)\('([^']+)'\)/", $recipients, $matches, PREG_SET_ORDER); var_export( array_map( fn($row) => ['name' => $row[1], 'email' => $row[2]], $matches ) );
You have javascript disabled. You will not be able to edit any code.