Say I start a PHP script via command line.
Is there a way that PHP can restart/rerun the script from the top via a command inside the PHP script?
<?php
if($something == 'yes')
{
// restart/rerun whole PHP script
}
?>
Say I start a PHP script via command line.
Is there a way that PHP can restart/rerun the script from the top via a command inside the PHP script?
<?php
if($something == 'yes')
{
// restart/rerun whole PHP script
}
?>
As told in comment you can send header.
or if you in the middle of page, you can add <script> tag with window.location.reload() there
needReload = false then all script in function. In case of success do nothing. If you need reload then needReload = true and return. In main script call function again in loop if true. But beware of endless cycle.