3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseTicketName($ticketName) { global $sites; //$system = substr($ticketName, 0, 2); // pull out managment system //$ticketName = substr($ticketName, 2); // remove management system preg_match('/^([[:alpha:]]+)([[:alpha:]]+)([[:digit:]]+)$/', $ticketName, $matches); var_dump($matches); exit; return array( 'system' => $system, 'project' => $matches[1], 'ticket_id' => $matches[2] ); } // 2 first characters is system, then the next letters are project name and the numbers are the ticket id $s = "ASFX10"; var_dump(parseTicketName($s));

preferences:
47.56 ms | 402 KiB | 5 Q