What is the issue with creating a host record A using PHP on a Windows Server 2008 with a DNS server role installed?

The issue with creating a host record A using PHP on a Windows Server 2008 with a DNS server role installed is that PHP does not have built-in functions to directly interact with the DNS server. One way to solve this issue is to use PowerShell commands within PHP to create the host record A on the DNS server.

<?php
$hostname = "example.com";
$ip_address = "192.168.1.1";

$command = "Add-DnsServerResourceRecordA -Name $hostname -ZoneName example.com -IPv4Address $ip_address";
exec("powershell.exe -Command $command");
?>