What are the potential benefits of using XAMPP over IIS for running PHP on a Windows system?

XAMPP is a free and open-source cross-platform web server solution package that includes Apache, MySQL, PHP, and Perl. It is easy to install and configure, making it a popular choice for developers who want to run PHP applications on Windows systems. XAMPP also provides a user-friendly control panel for managing server settings and services, making it easier to set up and maintain a development environment compared to IIS.

<?php
// Sample PHP code using XAMPP to connect to a MySQL database
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>