set count down cli php

Solutions on MaxInterview for set count down cli php by the best coders in the world

showing results for - "set count down cli php"
Amelie
06 May 2020
1<?php
2
3echo "Continue? (Y/N) - ";
4
5$stdin = fopen('php://stdin', 'r');
6$response = fgetc($stdin);
7if ($response != 'Y') {
8   echo "Aborted.\n";
9   exit;
10}
11
12$seconds = 5;
13
14for ($i = $seconds; $i > 0; --$i) {
15   echo $i;
16   usleep(250000);
17   echo '.';
18   usleep(250000);
19   echo '.';
20   usleep(250000);
21   echo '.';
22   usleep(250000);
23}
24
25echo " Running NOW\n";
26// run command here
27