Guest User

Untitled

a guest
Jun 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. function normalizeDial($what,$land) { // $land => 13:AT, 55:DE
  2.     global $DBc;
  3.     $what = str_replace("+","00",$what);
  4.     if($what{0} != "0") { // fehlende 0 am anfang ergänzen
  5.         $what = "0".$what;
  6.     }
  7.     if(substr($what,0,2) != "00") { //falls keine 00 am anfang, entferne führende 0, löse ländervorwahl auf und ergänze sie
  8.         if($what{0} == "0") {
  9.             $res = $DBc->sendSQL("SELECT l_dial FROM core_land WHERE l_id='".$land."'","ARRAY");
  10.             $what = $res[0]['l_dial'].substr($what,1,strlen($what));
  11.         }
  12.     }
  13.  
  14.     return $what;
  15. }
Add Comment
Please, Sign In to add comment