I guess the main problem is that $value2
contained an unexpected value.
It simply looks like you need to sanitise the string, removing any characters that might get in the way of your check (such as space and apostrophe / single-quote). Try this...
$checkiftime = trim($pieces3[0], " '\t\n\r\0\x0B");
See trim()
. Demo here - http://ideone.com/uVEDXM
Alternatively, you could simply use a regular expression match to check the entire string, eg
if (preg_match('/^\W*time\W*: (\d+)$/', $value2, $matches)) {
echo 'Yes!', PHP_EOL;
var_dump($matches); // $matches[1] contains the numeric value 1376952971
}
Demo - http://ideone.com/025vAV