Is there any command in PHP to stop executing the current or parent if
statement, same as break
or break(1)
for switch
/
To completely stop the rest of the script from running you can just do
exit; //In place of break. The rest of the code will not execute
Answering to your question whether that is achievable or not, then yes that is achievable using "goto" operator of php.
But ethically, its not a good practice to use "goto" and of there is any need to use goto then this means that code need to be reconstructed such that requirement of goto can be removed.
According to the sample code you posted above, it can be clearly seen that the code can be reconstructed and the code that is no more required can be either deleted or commented (if possibility is there for use in future).