Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $errorLogInput = $_GET['errorLog'];
- $exceptionPattern = '/(Exception in thread[\s\"\'a-z\.]+[a-z\.]+([A-Za-z\.]+):\s*\d*)\s*(at\s*([A-Za-z_-]+\.([a-zA-Z]+)+)\(([A-Za-z_-]+\.[a-zA-Z\d]+):(\d+)\))/';
- preg_match_all($exceptionPattern, $errorLogInput, $exceptionArr);
- $exceptionName = $exceptionArr[2];
- $methodName = $exceptionArr[5];
- $fileName = $exceptionArr[6];
- $lineNumber = $exceptionArr[7];
- $result = '';
- if (sizeof($testObject > 0)) {
- $result .= "<ul>";
- foreach ($lineNumber as $key => $value) {
- $result .= "<li>line <strong>";
- $result .= htmlspecialchars($lineNumber[$key]);
- $result .= "</strong> - <strong>";
- $result .= htmlspecialchars($exceptionName[$key]);
- $result .= "</strong> in <em>";
- $result .= htmlspecialchars($fileName[$key]);
- $result .= ":";
- $result .= htmlspecialchars($methodName[$key]);
- $result .= "</em></li>";
- }
- $result .= "</ul>";
- }
- echo $result;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement