How to pop an alert message box using php?

The alert message just like a popup window on the screen. Using this you can alert to the user with some information and message.

1. Code:

// PHP program to pop an alert message box on the screen
function function_alert($message) { 
    // Display the alert box 
    echo "<script>alert('$message');</script>";
// Function call
function_alert("Welcome to");

2. Example:


Message: "Welcome to"


Run the PHP program to pop up an alert box on the screen with the above message.