Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP die() from included page without dying from main page

Tags:

php

Is there a way to use the die() function to stop executing PHP statements on a page included on another page, but continue the execution of PHP statements on the page on which the file containing the die() function was included?

like image 274
Proffesor Avatar asked Dec 01 '22 00:12

Proffesor


1 Answers

use return; in your included file. It will stop this include execution. It works like a function. Also you can return a value from your included file

like image 200
pleerock Avatar answered Jan 04 '23 23:01

pleerock