<?php $string = 'Files("textfile1.txt", 7268474425, "textfile2.txt", 661204928, "textfile3.txt", 121034)'; $result = []; preg_match_all('/(?:^\w+\(|\G, )"([^"]+)", (\d+)/', $string, $matches, PREG_SET_ORDER); foreach ($matches as [1 => $key, 2 => $val]) { $result[$key] = (int) $val; } var_export($result);
You have javascript disabled. You will not be able to edit any code.