Online Demo Report

$code ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); return file('http://cppcheck.sourceforge.net/cgi-bin/democlient.cgi', false, $context); } function cut_string($string, $length = 1024) { if (strlen($string) > $length) { return substr($string, 0, $length); } return $string; } if ($isCodePosted) { //if code posted... echo "

Input

\n"; echo "
" . htmlspecialchars($_POST['code']) . "
\n"; echo "

Output

\n"; $code = cut_string($_POST['code']); $lines = get_democlient_outout($code); foreach ($lines as $line) { //for each output line... $line = trim($line); if (empty($line)) { //if empty line... continue; } echo "

" . htmlspecialchars($line) . "

\n"; } } else { echo "

Use the online demo page to create the report.

\n"; } ?>