3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = json_encode([ 'longname' => 'Office of the Attorney General - Department for Children & Families', 'list' => [ 'Thomas Allingham', 'Leslie Hanafin', 'Karen K. Reynolds', 'Robert Lees', 'Cindy Maguire', 'Julie Kolinich', 'Wendy Burroughs', 'Edward Kenney', 'Jody Racht', 'Marcia Garlisi', 'Deborah Celis', 'Ashley Harriman', 'Susan Cay', 'Zachary Martin', ], ], JSON_UNESCAPED_SLASHES); echo $test; exit; $jobRe = 'TEST NAME; 2025-08-20; 495035'; $re = explode(';', $jobRe); echo $re[0]; echo "\n"; echo $re[1]; echo "\n"; echo $re[2]; echo "\n"; $namearr = explode(' ', trim($re[0])); //$namearr = explode(' ', $re[0]); $firstname = $namearr[0]; echo $firstname; echo "\n"; $lastname = array_pop($namearr); echo $lastname; echo "\n"; $inmateshort = strtoupper($lastname . ', ' . substr($firstname, 0, 1)); $inmatelong = strtoupper($lastname . ', ' . $firstname); echo $inmateshort; echo "\n"; echo $inmatelong;
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
{"longname":"Office of the Attorney General - Department for Children & Families","list":["Thomas Allingham","Leslie Hanafin","Karen K. Reynolds","Robert Lees","Cindy Maguire","Julie Kolinich","Wendy Burroughs","Edward Kenney","Jody Racht","Marcia Garlisi","Deborah Celis","Ashley Harriman","Susan Cay","Zachary Martin"]}

preferences:
48.34 ms | 719 KiB | 4 Q