File: cputest.php

package info (click to toggle)
phpsysinfo 3.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,900 kB
  • sloc: javascript: 22,511; php: 20,651; xml: 18,293; sh: 196; python: 58; makefile: 12
file content (12 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
<?php
header('Content-Type: text/plain');
$filename = '/proc/cpuinfo';
$contents=file_get_contents($filename);
echo "----------".$filename."----------\n";
if (strlen($contents)>0) {
    if (substr($contents, -1)!="\n") {
        $contents.="\n";
    }
    $contents = preg_replace('/^(\s*serial\s*:\s*)(\S+)/im', '$1xxxxxxxxxxxxxxxx', $contents);
    echo $contents;
}