<?php
// PHP 8.5 recommended (latest stable in Jan 2026)

$api_url = "https://apidevelopers.ir/api/v1/random-password-generator";

$params = [
    'apiKey' => 'YOUR_API_KEY',

];

$options = [
    'http' => [
        'header'  => "Content-type: application/x-www-form-urlencoded",
        'method'  => 'POST',
        'content' => http_build_query($params),
        'ignore_errors' => true,
    ],
];

$context  = stream_context_create($options);
$response = file_get_contents($api_url, false, $context);

if ($response === false) {
    echo "Error occurred\n";
    // you can read $http_response_header for more info
} else {
    echo $response;
}
?>
#ParameterTypeDefaultDescriptionStatus
1apiKeystring-Your API key for authenticationRequired