Skip to content

Instantly share code, notes, and snippets.

@leapar
Created April 1, 2016 06:32
Show Gist options
  • Save leapar/d75e78974538c83aee3783f8716c6ac3 to your computer and use it in GitHub Desktop.
Save leapar/d75e78974538c83aee3783f8716c6ac3 to your computer and use it in GitHub Desktop.
function execInBackground ( $cmd ) {
if ( substr ( php_uname (), 0 , 7 ) == "Windows" ){
pclose ( popen ( "start /B " . $cmd , "r" ));
}
else {
exec ( $cmd . " > /dev/null &" );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment