Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php infinite loop

$interval=60; //minutes
  set_time_limit( 0 );
  $sleep = $interval*60-(time());

  while ( 1 ){
     if(time() != $sleep) {
       // the looping will pause on the specific time it was set to sleep
       // it will loop again once it finish sleeping.
       time_sleep_until($sleep); 
     }
     #do the routine job, trigger a php function and what not.
   }
Comment

infinite loop php

//this infinte loop never stops until the if condition became true 
while(1){
			if(/*condition to exit from while*/);break;}
			ob_flush();	
			flush();
			sleep(2);
        	}
Comment

PREVIOUS NEXT
Code Example
Php :: Redirect User To Different Page 
Php :: render html data from db laravel 
Php :: switching between php versions 
Php :: custom blade 
Php :: laravel model create get id 
Php :: if post checked category wordpress 
Php :: change laravel port 
Php :: how to check page loading time in php 
Php :: Create fake users on click laravel 
Php :: string put inside tag string php 
Php :: php object example 
Php :: docker php-fpm-apline add imagick 
Php :: hot to use functions in heredoc 
Php :: livewire check no errors 
Php :: laravel group concat values showing duplicate 
Php :: table laravel 
Php :: laravel route group 
Php :: debugbar:clear in laravel 
Php :: Add to cart, link to product page 
Php :: php 8 null safe operator 
Php :: checkout 
Php :: php preg_replace function 
Php :: What is the name of scripting engine in PHP? 
Php :: php monolog 
Php :: php is_link 
Php :: test_input php 
Php :: laravel eloquent with 
Php :: laravel echo 
Php :: get data from stdclass object php 
Php :: php versions and features 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =