当前位置:Linux教程 - Php - wap服务器如何知道用户手机号码

wap服务器如何知道用户手机号码

function getPhoneNumber()
    {
        if (isset($_SERVER['HTTP_X_NETWORK_INFO']))
        {
            $str1 = $_SERVER['HTTP_X_NETWORK_INFO'];
            $phone = preg_replace('/(.*,)(11[d])(,.*)/i','\2',$str1);
            Return $phone;
        }
        elseif (isset($_SERVER['HTTP_X_UP_CALLING_LINE_ID']))
        {
            $phone = $_SERVER['HTTP_X_UP_CALLING_LINE_ID'];
            Return $phone;
        }
        elseif (isset($_SERVER['HTTP_X_UP_SUBNO']))
        {
            $str3 = $_SERVER['HTTP_X_UP_SUBNO'];
            $getstr3 = preg_replace('/(.*)(11[d])(.*)/i','\2',$str3);
            Return $phone;
        }
        elseif (isset($_SERVER['DEVICEID']))
        {
            $phone = $_SERVER['DEVICEID'];
             Return $phone;
        }
        else
        {
             $phone=123;
            Return $phone;
        }
    }