

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
exit() function in PHP
The exit() function prints a message and exits the current script.
Syntax
exit(msg)
Parameters
msg − The message to write before exiting the script.
Return
The exit() function returns nothing.
Example
<?php $url = "https://www.example.com/"; fopen($url,"r") or exit("Can't connect!"); ?>
Output
The following is the output.
Can’t connect!
- Related Questions & Answers
- What is exit() function in C language?
- exit() vs _Exit() function in C and C++
- What are the differences in die() and exit() in PHP?
- Difference Between exit(0) and exit(1)
- Exit Methods in C# Application
- file_exists() function in PHP
- basename( ) function in PHP
- chgrp()function in PHP
- chmod() function in PHP
- chown() function in PHP
- clearstatcache() function in PHP
- copy() function in PHP
- delete() function in PHP
- dirname()function in PHP
- disk_free_space() function in PHP
Advertisements