Php 如何将xml查询从tcp移动到udp

Php 如何将xml查询从tcp移动到udp,php,curl,udp,Php,Curl,Udp,我曾经创建过一个模板,如: $template = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; $template.= "<request>"; $template.= " <auth>"; $template.= " <userid>".$USER_ID."</userid>"; $template.= " <apikey>".$API_KEY."

我曾经创建过一个模板,如:

$template = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$template.= "<request>";
$template.= "   <auth>";
$template.= "       <userid>".$USER_ID."</userid>";
$template.= "       <apikey>".$API_KEY."</apikey>";
$template.= "   </auth>";
$template.= "   <language>".$LANGUAGE."</language>";
$template.= "   <task>";
$template.= "       <vertragid>".$VERTRAGID."</vertragid>";
$template.= "       <data>";
$template.= "           <countrycode>".$COUNTRYCODE."</countrycode>";
$template.= "       </data>";
$template.= "   </task>";
$template.= "</request>";
并使用curl获取数据

现在我必须通过UDP端口连接


有谁能给我一个起点或给我一个例子来说明如何做到这一点吗?

为什么要使用UDP连接?服务器需要它!!!!