What specific connection string format was successful in establishing a connection to a MSSQL database in PHP?

To establish a connection to a MSSQL database in PHP, the connection string format should include the server name, database name, username, and password. Additionally, the driver should be specified as "sqlsrv" for MSSQL database connections in PHP.

$serverName = "yourServerName";
$connectionOptions = array(
    "Database" => "yourDatabaseName",
    "Uid" => "yourUsername",
    "PWD" => "yourPassword"
);

$conn = sqlsrv_connect($serverName, $connectionOptions);

if ($conn) {
    echo "Connection established.";
} else {
    echo "Connection could not be established.";
}