Which function is used for terminate the script execution in PHP?

Author Topic: Which function is used for terminate the script execution in PHP?  (Read 6931 times)

Offline hirephpTopic starter

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 10
  • Karma: 1
  • Gender: Male
  • Hirephp
    • Hire PHP Developer, Hire PHP Programmer, Hire PHP Web Developer, PHP Framework Solutions
Which function is used for terminate the script execution in PHP?




Website Designer | Hire Website Designer visit hirephp.com



Hire PHP Coder [nofollow] | Hire PHP Developer [nofollow]


Offline thelazytrader

  • Trade Count: (0)
  • Jr. Member
  • **
  • Thank You 2
  • Posts: 92
  • Karma: 0
  • Gender: Male
  • The Lazy Trader
    • The Lazy Trader
die and exit functions both are using to terminate the script in php.


Offline Luca tall

  • Trade Count: (0)
  • Jr. Member
  • **
  • Thank You 3
  • Posts: 53
  • Karma: 0
  • Gender: Male
    • PHP Training in Chennai

1. break()
2. quit()
3. die()
These are the functions used for terminating the script execution in PHP.

Offline keith.bowman

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 10
  • Karma: 0
  • Gender: Male
The following function are used for terminate the script execution in PHP
1)   Quit()
2)   Break()
3)   Die()
Asuem Infotech [nofollow]

Offline qx_1789

  • Trade Count: (0)
  • Jr. Member
  • **
  • Thank You 1
  • Posts: 73
  • Karma: 0
  • Working in QualityPoint Technologies
    • https://www.youtube.com/user/qualitypointtech/
die() is just an alias for exit() so there is absolutely no difference in how to use it or what it does.

So die() is not only equivalent to exit(), it is actually the exact same function just with a different name.
You should use exit function to terminate the script execution in php.

Learn more about php from learnwebdevelopment.info


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
4209 Views
Last post 11-04-2011, 00:33:08
by mack0
1 Replies
3814 Views
Last post 07-17-2012, 00:22:23
by thelazytrader
0 Replies
2646 Views
Last post 05-26-2015, 22:52:51
by jaysh4922
1 Replies
2956 Views
Last post 10-10-2022, 04:57:16
by f1dark
2 Replies
6243 Views
Last post 08-02-2021, 01:46:40
by julia timpi