- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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!
Advertisements