For example, I want change PC time in console.
C:\Users\user>time
The current time is: 15:25:21,04
Enter the new time:
PHP:
exec('time', $out, $ret);
/*
$out =
The current time is: 15:25:21,04
Enter the new time:
*/
How to send new time ?
Upd
Without 1 line commands echo <timestring> | time
#Thx to reox
#Working example:
$next_hour = date('H:i:s', strtotime('+1 hour'));
$command = 'time';
$handle = popen($command, 'r');
echo 'Command responce: <br>';
while($line = fgets($handle)) {
echo $line;
echo '<br>';
}
pclose($handle);
$handle = popen($command, 'w');
fputs($handle, $next_hour);
pclose($handle);