#!/usr/bin/env php open/coverage.php?coverage=0\n", "", $file); $file = str_replace("clicklink=Explain\nverifyTextPresentClustered Index Scan\n", "", $file); // MS SQL PDO doesn't support EXPLAIN preg_match_all("~//input\[@value='Login']~", $file, $matches, PREG_OFFSET_CAPTURE); list($val, $offset) = $matches[0][count($matches[0]) > 1 ? 1 : 0]; // MySQL log-ins three times, we check the second one $file = substr_replace($file, "\nverifyTextPresentPDO_", $offset + strlen($val), 0); file_put_contents("pdo-$filename", $file); } }