Get the contents of a variable from an external file and display the contents

The file “versionen.php” is in the “dataplace” folder in all defined domain-accounts.
I would like to use the following script to read and output the “$software_version” variable for all defined domains on an external domain.
The “$software_version” variable is in the “versionen.php” file and is also displayed correctly locally.
The URL is loaded correctly, which is also displayed correctly by the Else branch of “if ($content === false) {“.
The domains are displayed correctly in the test output, but “Software-Empty” is always displayed for “$version”.
I just can’t get the content of the “$software_version” variable to work.
What have I not taken into account? What needs to be changed/added?

    error_reporting(E_ALL);
ini_set('display_errors', '1');

// FTP-Zugangsdaten für alle URLs (1 bis x) | FTP access data for all URLs (1 to x)
$ftpCredentialsList = array(
    1 => array("hostname" => "url-1.tld", "username" => "xxxxxxxx", "password" => "yyyyyyyy"),
    2 => array("hostname" => "url-2.tld", "username" => "xxxxxxxx", "password" => "yyyyyyyy"),
    3 => array("hostname" => "url-3.tld", "username" => "xxxxxxxx", "password" => "yyyyyyyy"),
    4 => array("hostname" => "url-4.tld", "username" => "xxxxxxxx", "password" => "yyyyyyyy"),
    5 => array("hostname" => "url-5.tld", "username" => "xxxxxxxx", "password" => "yyyyyyyy"),
);

########## Software-Release ##########

// Funktion, um die Software-Version einer URL abzurufen | Function to retrieve the software version of a URL
function getSoftwareVersion($url) {
    // cURL-Verbindung erstellen | Create cURL connection
    $curl = curl_init($url);

    // Optionen für cURL festlegen | Setting options for cURL
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); // Folge Umleitungen | Follow redirects

    // Inhalt der Datei abrufen | Retrieve file contents
    $content = curl_exec($curl);

    if ($content === false) {
        die("Fehler beim Abrufen der Software-Version für $url: " . curl_error($curl)"| Error retrieving software version for $url: " . curl_error($curl));
    } else {
        // echo 'Abruf der Software-Version für '.$url.' war erfolgreich. | Retrieving the software version for '.$url.' was successful.<br>';
    }

    // Die Variable $software_version aus dem Inhalt extrahieren | Extract the variable $software_version from the content
    preg_match('/$software_versions*=s*(.*?);/i', $content, $matches);
    $softwareVersion = isset($matches[1]) ? $matches[1] : null;

// Debugging-Ausgabe | Debugging output
echo "Regex-Matches: ";
var_dump($matches);
echo "<br>";

echo "Software-Version: ";
var_dump($softwareVersion);
echo "<br>";
// Ende Debugging

    curl_close($curl);

    return $softwareVersion;
}

// Ergebnisse speichern | Save results
$softwareVersions = array();

foreach ($ftpCredentialsList as $index => $ftpCredentials) {
    $url = "https://{$ftpCredentials['hostname']}/dataplace/versionen.php";
    $softwareVersion = getSoftwareVersion($url);

    // Überprüfen, ob die Software-Version gültig ist, bevor Farbe zugewiesen wird
    // Check if the software version is valid before assigning color
    $colorClass = 'software_empty'; // Standardfarbe, wenn die Software-Version leer ist | Default color if the software-version is empty
    if ($softwareVersion !== null) {
        $colorClass = (stripos($softwareVersion, 'software_red') !== false ? 'software_red' : 'software_green');
    }

    // Ergebnisse in Array speichern | Save results in array
    $softwareVersions[$ftpCredentials['hostname']] = (empty($softwareVersion) ? "Software-Empty" : htmlspecialchars($softwareVersion));

    // Farbinformationen zusätzlich speichern | Store additional color information
    $softwareVersions['color'][$ftpCredentials['hostname']] = $colorClass;
}

// Testausgabe | Test issue
foreach ($softwareVersions as $hostname => $version) {
    if (!is_array($version)) { // Überprüfen, ob $version kein Array ist | Check if $version is not an array
        echo "<b>Hostname: <span style="color: #00F;">$hostname</span> > Software-Version: <span style="color: #00F;">$version</span><br>";
    }
}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật