", $start + strlen($first)); $substring = substr($content, $start+$first, $end-$start); $function = substr($substring, strpos($substring, "/**")); $function = str_replace("function ", "", $function); $function = str_replace("() {", " : function () {", $function); // parse out the actual function array_push($functionBodies, trim($function)); } file_put_contents($outputFile, "exports.tests = {\n".implode(",\n", array_filter($functionBodies)) . '\n}');