Results 1 to 4 of 4

Thread: [RESOLVED]How to stop code execution in PHP?

  1. #1

    Thread Starter
    Lively Member rasana's Avatar
    Join Date
    Jan 2007
    Location
    Mumbai, (India)
    Posts
    94

    Resolved [RESOLVED]How to stop code execution in PHP?

    Hi all,

    like in ASP we use
    response.End()
    to stop code execution in between..
    is there any function in php to stop code execution in between?
    Last edited by rasana; Oct 23rd, 2007 at 02:46 AM.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: How to stop code execution in PHP?

    You can use exit() or die() to terminate the script if you must, but it's preferable to structure your code so that you don't have to.

  3. #3

    Thread Starter
    Lively Member rasana's Avatar
    Join Date
    Jan 2007
    Location
    Mumbai, (India)
    Posts
    94

    Re: How to stop code execution in PHP?

    Thanks penagate!!
    sometimes what happnes we require to check whether data is
    coming properly or not..so to just echo variables and stop further execution we require exit() or die()
    i.e. to check mysql query whether given where claus contains data or not.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED]How to stop code execution in PHP?

    Oh, of course, if it's for debugging then that's fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width