<?php class mobile{ function getPhoneNumber(){ if (isset($_SERVER[ 'HTTP_X_NETWORK_INFO '])){ $str1 = $_SERVER[ 'HTTP_X_NETWORK_INFO ']; $getstr1 = preg_replace( '/(.*,)(11[d])(,.*)/i ', '2 ',$str1); Return $getstr1;