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

Output

The following is the output.

Can’t connect!
Updated on: 2019-12-30T06:36:53+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements