PHP Function required similar to die() function

General discussion on PHP
Post Reply
jack9632
Posts: 13
Joined: Fri Feb 22, 2013 8:21 am
Location: 50 Riverside Drive, New York, NY 10024, USA
Contact:

PHP Function required similar to die() function

Post by jack9632 » Mon Jun 10, 2013 7:21 am

I am developing a web using PHP. When some of the given condition is not true, I use die() function to terminate the rest of the PHP code execution. But with the termination of the PHP code, the HTML code is also terminated. I want such a function that only terminate the PHP execution and does not effect the HTML.

tedtiger
Posts: 244
Joined: Thu Mar 05, 2009 4:59 pm
Location: Germany
Contact:

Re: PHP Function required similar to die() function

Post by tedtiger » Mon Jun 10, 2013 11:37 am

Refactor your code. According to your description you have some serious design problems.

amar9111
Posts: 18
Joined: Tue Apr 30, 2013 9:48 am

Re: PHP Function required similar to die() function

Post by amar9111 » Thu Jun 13, 2013 11:27 pm

I think u looking something like
if(ture){
echo 'yes';
}else{
do nothing
}
or you can use
Try{


}catch exception

Post Reply