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 4359 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 0
  • 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 0
  • 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 0
  • Posts: 74
  • 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
2736 Views
Last post 11-04-2011, 00:33:08
by mack0
1 Replies
2488 Views
Last post 07-17-2012, 00:22:23
by thelazytrader
0 Replies
796 Views
Last post 05-26-2015, 22:52:51
by jaysh4922
0 Replies
949 Views
Last post 12-19-2015, 02:55:07
by chinmay.sahoo
0 Replies
484 Views
Last post 05-04-2016, 08:27:34
by Akash Varma