function getMSNTVHash($hash,$nospace=0) { if (strlen($hash) != 32) { return false; } $section1a = substr($hash,0,2); $section1b = substr($hash,2,2); $section1c = substr($hash,4,2); $section1d = substr($hash,6,2); $section2a = substr($hash,8,2); $section2b = substr($hash,10,2); $section2c = substr($hash,12,2); $section2d = substr($hash,14,2); $section3a = substr($hash,16,2); $section3b = substr($hash,18,2); $section3c = substr($hash,20,2); $section3d = substr($hash,22,2); $section4a = substr($hash,24,2); $section4b = substr($hash,26,2); $section4c = substr($hash,28,2); $section4d = substr($hash,30,2); $hash = strtoupper($section1d.$section1c.$section1b.$section1a." ". $section2d.$section2c.$section2b.$section2a." ". $section3d.$section3c.$section3b.$section3a." ". $section4d.$section4c.$section4b.$section4a); if ($nospace) { return str_replace(" ","",$hash); } else { return $hash; } }