public function getVersion()
    {
        $cpuinfo = preg_split("/\n/", file_get_contents('/proc/cpuinfo'));
        foreach ($cpuinfo as $line) {
            if (preg_match('/Revision\s*:\s*([^\s]*)\s*/', $line, $matches)) {
                return hexdec($matches[1]);
            }
        }

        return 0;
    }
public function getVersion()
    {
        $cpuinfo = preg_split("/\n/", file_get_contents('/proc/cpuinfo'));
        foreach ($cpuinfo as $line) {
            if (preg_match('/Revision\s*:\s*([^\s]*)\s*/', $line, $matches)) {
                return hexdec($matches[1]);
            }
        }

        return 0;
    }
public function getVersion ( ) { $ cpuinfo = preg_split ( "/\n/" , file_get_contents ( '/proc/cpuinfo' ) ) ; foreach ( $ cpuinfo as $ line ) { if ( preg_match ( '/Revision\s*:\s*([^\s]*)\s*/' , $ line , $ matches ) ) { return hexdec ( $ matches [ 1 ] ) ; } } return 0 ; }
Get RaspberryPi version

A list of Model and Pi Revision & Hardware Revision Code from '/proc/cpuinfo' is here:
@link http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/

@return decimal Raspi version
Get RaspberryPi version