How can the .htaccess file be translated to web.config for Microsoft IIS server in the context of URL rewriting in PHP?

When migrating a website from Apache server to Microsoft IIS server, the .htaccess file needs to be translated to web.config for URL rewriting in PHP. This can be achieved by converting the Apache rewrite rules in .htaccess to the equivalent rules in web.config format for IIS server.

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Rewrite to index.php">
                    <match url="^(.*)$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php?url={R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>