Answers for "incement count cli php"

PHP
1

get count sql query in php

$result=mysql_query("SELECT count(*) as total from Students");
$data=mysql_fetch_assoc($result);
echo $data['total'];
Posted by: Guest on February-18-2021
0

set count down CLI php

<?php

echo "Continue? (Y/N) - ";

$stdin = fopen('php://stdin', 'r');
$response = fgetc($stdin);
if ($response != 'Y') {
   echo "Aborted.\n";
   exit;
}

$seconds = 5;

for ($i = $seconds; $i > 0; --$i) {
   echo $i;
   usleep(250000);
   echo '.';
   usleep(250000);
   echo '.';
   usleep(250000);
   echo '.';
   usleep(250000);
}

echo " Running NOW\n";
// run command here
Posted by: Guest on September-30-2020

Browse Popular Code Answers by Language