Is querying an ICQ server a reliable method for checking ICQ numbers with PHP?

Querying an ICQ server directly may not be a reliable method for checking ICQ numbers with PHP as the server's response format or availability could change. A more reliable approach would be to use an API provided by ICQ or a third-party service that offers ICQ number validation.

// Example using a third-party API for ICQ number validation
$icqNumber = '123456789';
$apiKey = 'your_api_key_here';

$url = "https://api.icq.net/validate?icq=$icqNumber&apikey=$apiKey";

$response = file_get_contents($url);
$data = json_decode($response, true);

if ($data['valid']) {
    echo "ICQ number is valid";
} else {
    echo "ICQ number is invalid";
}