Skip to content

Instantly share code, notes, and snippets.

@baznak
Last active September 4, 2019 21:25
Show Gist options
  • Save baznak/b23a0045c4046147040abaccb54d8c85 to your computer and use it in GitHub Desktop.
Save baznak/b23a0045c4046147040abaccb54d8c85 to your computer and use it in GitHub Desktop.
<?php
define('ROOT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/');
define('ROOTS', $_SERVER['DOCUMENT_ROOT'] . '/');
//define('ROOT_DIR', dirname(__FILE__).'/');
function getUrl($url, $time = 30)
{
$url = str_replace(' ', '%20', trim($url));
$list = array(
'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Windows NT 7.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/65.0',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36',
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-en) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36',
'Mozilla/5.0 (Windows NT 7.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36'
);
shuffle($list);
$list = $list[0];
$refer = array(
'https://www.google.com',
'https://www.instagram.com',
'https://www.facebook.com',
'https://i.facebook.com',
'http://www.payvandha.ir',
'https://forum.prsiantools.com'
);
shuffle($refer);
$ref = $refer[0];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_REFERER, $ref);
curl_setopt($ch, CURLOPT_USERAGENT, $list);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_TIMEOUT, $time);
curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
$result = curl_exec($ch);
$getinfo = curl_getinfo($ch);
curl_close($ch);
if ($getinfo['http_code'] != 200)
return false;
return $result;
}
function getUrlNamnak($url, $time = 30)
{
$url = str_replace(' ', '%20', trim($url));
$list = array(
'Googlebot/2.1 (+http://www.google.com/bot.html)'
);
shuffle($list);
$list = $list[0];
$refer = array(
'https://www.google.com',
'https://www.instagram.com',
'https://www.facebook.com',
'https://i.facebook.com',
'http://www.payvandha.ir',
'https://forum.prsiantools.com'
);
shuffle($refer);
$ref = $refer[0];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_REFERER, 'https://www.google.com');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_TIMEOUT, $time);
curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
$result = curl_exec($ch);
$getinfo = curl_getinfo($ch);
curl_close($ch);
if ($getinfo['http_code'] != 200)
return false;
return $result;
}
function DomainGetNode($zone = 'world')
{
$zone = strtolower($zone);
$domainsGet = array(
// 'http://goourlshortener.ir/get/pr.php?u=',
'http://telegramurlshortener.ir/pr.php?u=', //iranika iran
'http://xznirda1.xabzar.com/pr.php?u=', //xznirda za5.ir
'http://je4.ir/pr.php?u=', //xznircpanel
'http://xznirdlda1.xabzar.com/pr.php?u=', //xznirdlda fg4.ir
'http://xznwin1.xabzar.com/pr.php?u=', //xznirwin jh1.ir
'http://cf5.ir/pr.php?u=', //cpanel.ir ir1
'http://orohostir1.xabzar.com/pr.php?u=', //orohost.com iran cpanel
'http://orohostge1.xabzar.com/pr.php?u=', //orohost.com germany cpanel
// 'http://robotlinkshortener.ir/get/pr.php?u=',
'http://zarkasb.com/get/pr.php?u='
// 'http://xznir1.xabzar.com/get/pr.php?u=',
// 'http://businesslinkshortener.ir/get/pr.php?u='
);
if ($zone == 'ir') {
$domainsGet = array(
// 'http://goourlshortener.ir/get/pr.php?u=',
'http://telegramurlshortener.ir/pr.php?u=', //iranika iran
'http://xznirda1.xabzar.com/pr.php?u=', //xznirda
'http://je4.ir/pr.php?u=', //xznircpanel
'http://xznirdlda1.xabzar.com/pr.php?u=', //xznirdlda
'http://orohostir1.xabzar.com/pr.php?u=', //orohost.com iran cpanel
'http://cf5.ir/pr.php?u=', //cpanel.ir ir1
// 'http://externallinkshortener.ir/get/pr.php?u=',
// 'http://robotlinkshortener.ir/get/pr.php?u=',
// 'http://zarkasb.com/get/pr.php?u='
// 'http://xznir1.xabzar.com/get/pr.php?u=',
// 'http://businesslinkshortener.ir/get/pr.php?u='
);
}
shuffle($domainsGet);
return $domainsGet[0];
}
function DomainGetNamnak($zone = 'world')
{
$zone = strtolower($zone);
$domainsGet = array(
// 'http://goourlshortener.ir/get/pr.php?u=',
// 'http://telegramurlshortener.ir/nam.php?u=', //iranika iran
'http://xznirda1.xabzar.com/nam.php?u=', //xznirda za5.ir
'http://je4.ir/nam.php?u=', //xznircpanel
'http://xznirdlda1.xabzar.com/nam.php?u=', //xznirdlda fg4.ir
'http://xznwin1.xabzar.com/nam.php?u=', //xznirwin jh1.ir
'http://cf5.ir/nam.php?u=' //cpanel.ir ir1
// 'http://orohostir1.xabzar.com/nam.php?u=', //orohost.com iran cpanel
// 'http://orohostge1.xabzar.com/nam.php?u=' //orohost.com germany cpanel
// 'http://robotlinkshortener.ir/get/pr.php?u=',
// 'http://zarkasb.com/get/nam.php?u='
// 'http://xznir1.xabzar.com/get/pr.php?u=',
// 'http://businesslinkshortener.ir/get/pr.php?u='
);
if ($zone == 'ir') {
$domainsGet = array(
// 'http://goourlshortener.ir/get/pr.php?u=',
// 'http://telegramurlshortener.ir/nam.php?u=', //iranika iran
'http://xznirda1.xabzar.com/nam.php?u=', //xznirda
'http://je4.ir/nam.php?u=', //xznircpanel
'http://xznirdlda1.xabzar.com/nam.php?u=', //xznirdlda
'http://orohostir1.xabzar.com/nam.php?u=', //orohost.com iran cpanel
'http://cf5.ir/nam.php?u=', //cpanel.ir ir1
// 'http://externallinkshortener.ir/get/pr.php?u=',
// 'http://robotlinkshortener.ir/get/pr.php?u=',
// 'http://zarkasb.com/get/pr.php?u='
// 'http://xznir1.xabzar.com/get/pr.php?u=',
// 'http://businesslinkshortener.ir/get/pr.php?u='
);
}
shuffle($domainsGet);
return $domainsGet[0];
}
function file_force_contents($dir, $contents, $append = false)
{
$parts = explode('/', $dir);
$file = array_pop($parts);
$dir = '';
foreach ($parts as $part) {
if ($part != '') {
if (!is_dir($dir .= "/$part")) mkdir($dir);
}
}
if ($append) {
file_put_contents("$dir/$file", $contents, FILE_APPEND | LOCK_EX);
} else {
file_put_contents("$dir/$file", $contents);
}
}
function dirExists($dir)
{
if (!@is_dir($dir)) {
@mkdir($dir, 0777, true);
}
}
function isValid($check)
{
$regEx = "/^[a-zA-Z0-9-\/\+\_\.\@]+$/";
if (@preg_match($regEx, $check)) {
return true;
} else {
return false;
}
}
function getMimType($format)
{
$array = array(
'png' => 'image/png',
'jpe' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'gif' => 'image/gif'
);
$format = strtolower($format);
if (isset($array[$format])) {
return $array[$format];
}
return false;
}
function _randArray($array, $key = 0)
{
shuffle($array);
shuffle($array);
shuffle($array);
return $array[$key];
}
function doMagic($url, $time = 20, $maxRedirect = 2)
{
$url = str_replace(" ", "%20", $url);
$curl = curl_init();
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
$header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
$header[] = "Cache-Control: max-age=0";
$header[] = "Connection: keep-alive";
$header[] = "Keep-Alive: 300";
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$header[] = "Accept-Language: en-us,en;q=0.5";
$header[] = "Pragma: ";
$list = array(
'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0',
'Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30',
'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'
);
$userAgent = $list[rand(0, count($list) - 1)];
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT, $userAgent);
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_REFERER, "http://www.facebook.com");
curl_setopt($curl, CURLOPT_ENCODING, "gzip,deflate");
curl_setopt($curl, CURLOPT_AUTOREFERER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, $time);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_MAXREDIRS, $maxRedirect);
$html = curl_exec($curl);
$getinfo = curl_getinfo($curl);
curl_close($curl);
// print_r($getinfo);
$html = "http_code:" . $getinfo['http_code'] . "\n" . $html;
// if ($getinfo['http_code'] != 200)
// return false;
return $html;
}
function _outData($data)
{
return html_entity_decode($data);
}
//read all dir and file in once masir
function getDirContents($dir, &$results = array())
{
$files = scandir($dir);
foreach ($files as $key => $value) {
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
if (!is_dir($path)) {
$results[] = $path;
} else if ($value != "." && $value != "..") {
getDirContents($path, $results);
$results[] = $path;
}
}
return $results;
}
function returnValidTitle($text)
{
// $sting= '٩٨٥٤٠٣٧٦٣٢١';
/*// search stings
$seachstrings = array("١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩", "٠");
// replace strings
$replacestrings= array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
// replace function
$result= str_replace($seachstrings , $replacestrings, $sting);*/
$text1 = strtr($text, array('۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4', '۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9', '٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4', '٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9'));
$fcat = mb_ereg_replace('[^آ-یa-zA-Z0-9 ]+', ' ', $text1);
return ($fcat);
}
function returnValidTitle1($text)
{
// $sting= '٩٨٥٤٠٣٧٦٣٢١';
/*// search stings
$seachstrings = array("١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩", "٠");
// replace strings
$replacestrings= array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
// replace function
$result= str_replace($seachstrings , $replacestrings, $sting);*/
$text1 = strtr($text, array('۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4', '۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9', '٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4', '٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9'));
$fcat = mb_ereg_replace('[^آ-یa-zA-Z0-9 ]+', ' ', $text1);
return ($fcat);
}
function clean($data)
{
$data = trim($data);
$data = str_ireplace("'", '', $data);
$data = stripslashes($data);
$data = addslashes($data);
$data = htmlspecialchars($data);
return $data;
}
function _cleanTag($string, $valid = '')
{
return trim(strip_tags($string, $valid));
}
function _enToFa($srting)
{
$en_num = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$fa_num = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹");
return str_replace($en_num, $fa_num, $srting);
}
function _faToEn($srting)
{
$en_num = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$fa_num = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹");
return str_replace($fa_num, $en_num, $srting);
}
function getFormat($name)
{
$getFormat = explode(".", $name);
$getFormat = strtolower(end($getFormat));
return $getFormat;
}
//list asami 1256 adad
$names = array(
'وَرد', 'پوران', 'آذرباد', 'گلبانو', 'گلی', 'گوهرشید', 'پَرنگ', 'گهرچهر', 'تابش', 'آزاده', 'ماه دیس', 'پرتو', 'بَگاش', 'هَژیر', 'پاداش', 'تَهماسب', 'پویان', 'گرامی', 'هُرمز', 'پگاه', 'انوشیروان', 'زری', 'فْرَََوَرِتیش', 'ساویس', 'هومَت', 'لاله رو', 'دادپویه', 'مینا', 'پَشَنگ', 'سُرایش', 'فَرَوَشی', 'شیده', 'سیاوخش', 'شتاب', 'فرزانه', 'نسیم', 'کیکاووس', 'پیشداد', 'نازپری', 'دَسَم', 'پریفام', 'مهرنوش', 'کیوانزاد', 'شهرود', 'شیروان', 'پژمان', 'هوشیدر', 'رَسابانو', 'نوش آذر', 'بِهراد', 'کامکار', 'پریماه', 'فریناز', 'آوا', 'سیمین رخ', 'شادکام', 'وارسته', 'آهنگ', 'گردیه', 'پانته‌آ', 'شهرَوان', 'مهرآور', 'زیگ', 'سوشیانت', 'بهگل', 'نیایش', 'گوهربانو', 'گل سان', 'مهدخت', 'همگام', 'تور', 'پیراسته', 'نوبهار', 'بَرمک', 'افسانه', 'خشنود', 'مزدک', 'سوزان', 'هاله', 'کرتیر', 'نیسان', 'ارنواز', 'شهرزاد', 'سرافراز', 'زروان', 'زیبارخ', 'مازار', 'نرگس', 'آذرپناه', 'نیکزاد', 'مهرچهر', 'گرایش', 'سرور', 'مهرخ', 'گالوس', 'پروانه', 'هیمه', 'پریگون', 'شادمان', 'آترین', 'واژه', 'روشن', 'سامان', 'هور', 'گل آگین', 'گلچهره', 'مشیا', 'زُمرد', 'هوشبام', 'گل اندام', 'هُژبر', 'غنچه', 'تندیس', 'آرام دل', 'کمبوجیه', 'رامیار', 'گل آویز', 'گلبن', 'اشوروی', 'اوستا', 'آبدوس', 'سمن رخ', 'نساک', 'زیور', 'آزادچهر', 'اَرتان', 'پیروز', 'خدیو', 'اختر', 'فولاد', 'داراب', 'مروارید', 'خوشچهر', 'شراره', 'اوس', 'هَخامنش', 'تناز', 'زرنگار', 'آزاد', 'مژگان', 'رهی', 'اروتَدنر', 'خورسند', 'واپسین', 'چیترا', 'سنبل', 'گلباش', 'پویا', 'کیامنش', 'مهربُرزین', 'ایراندخت', 'مهرافزون', 'شیدوَر', 'مهران', 'آذرآیین', 'نورسته', 'ایزدیار', 'اورمزدیار', 'زربانو', 'گل آذین', 'یزدانشاه', 'گل خند', 'ارجمند', 'کیانبانو', 'خورشاد', 'چهرزاد', 'گلدسته', 'خوش‌منش', 'کامران', 'شاداب', 'سزاوار', 'راد', 'تخشک', 'سَروَر', 'سام', 'بِهزاد', 'فرنی', 'کیا', 'خرم چهر', 'مهریار', 'لاله', 'شکوه', 'شیدفر', 'مهرپرور', 'تشتر', 'اشکان', 'سیمروی', 'گل آسا', 'شبنم', 'رامک', 'همافر', 'ایشتار', 'کاووس', 'پریروی', 'رَسام', 'بهنوش', 'آشوب', 'ژاماسب', 'آذرخش', 'چلیپا', 'راتین', 'گیل', 'سینا', 'شنایا', 'ستُرگ', 'ستی', 'جلگه', 'لَچَک', 'بِهروز', 'اسامی نامهای دختران', 'سمنزار', 'جانمهر', 'فیروز', 'گلدیس', 'روناک', 'مهوش', 'دادفر', 'فرزین', 'گژگین', 'آشنا', 'مهرافشان', 'نارون', 'به آفرید', 'الف', 'جانان', 'شایان', 'دنبره', 'تنبور', 'هورچهر', 'فرداد', 'فرهومند', 'وخش', 'سوگل', 'نمایان', 'افشان', 'مرجان', 'هامرز', 'مزدا', 'جان پرور', 'آرمان', 'کیانمهر', 'کاردار', 'آذر', 'دُردانه', 'سارا', 'خاور', 'شیرمرد', 'تکاو', 'تِهرت', 'گلرخ', 'ژیان چهر', 'آناهیتا', 'شادمان', 'بَدخشان', 'کاویش', 'فرسیما', 'بردبار', 'ارجاسب', 'نیکدل', 'تِیتَک', 'فلامک', 'ماسیس', 'دنیا', 'فرمهر', 'شادی افزا', 'رادین', 'دادجو', 'روژین', 'نیکدخت', 'گوهرناز', 'فرشته', 'مهروی', 'وَلخش', 'فربود', 'اشودخت', 'فایدیم', 'شهرخ', 'پارند', 'دیناز', 'شادنوش', 'تهمینه', 'ارمغان', 'مهرزاد', 'بانو گشسب', 'اَپروَیژ', 'ارژنگ', 'اپرنگ', 'مانترَه', 'آشتی', 'ویس', 'پدرام', 'بیژن', 'تذرو', 'مهین', 'آیریک', 'شهرناز', 'گژدهم', 'دل انگیز', 'مخمل', 'فریدون', 'اُوژن', 'فرازمان', 'سُروش', 'رها', 'تکاپو', 'سیندخت', 'بوته', 'یادگار', 'رخشا', 'گوارا', 'بهرام', 'مژده', 'کامدین', 'رادمهر', 'بُندار', 'آویز', 'دادبه', 'اهورا', 'شهسوار', 'اَرشام', 'گودرز', 'لیو', 'آندیا', 'هاون', 'سیما', 'پوروچیستا', 'رام دخت', 'ماهرُخ', 'آویشن', 'دُرافشان', 'سپیدار', 'پَریبُرز', 'کتایون', 'ساغر', 'تهمورس', 'شهرو', 'نیو', 'فرخ', 'الوند', 'هوبَر', 'اسپاد', 'هنگامه', 'فرنوش', 'نیکروی', 'گلزاد', 'شیردل', 'مهرافروز', 'تُرنج', 'دل آشوب', 'فرشوشتر', 'همساز', 'گَرشاسب', 'ریواس', 'یزدگرد', 'اَهونَوَر', 'کورنگ', 'بُزرگمهر', 'نوشی', 'هوتن', 'تَرَنُم', 'روشاک', 'پرخیده', 'شادمهر', 'زَواره', 'مهرجو', 'اَبدَه', 'سالومه', 'همتا', 'کوشا', 'خورشید', 'خدابخش', 'اَوَرداد', 'جوانه', 'یاس', 'هورسان', 'به نگار', 'مهرنواز', 'شرمین', 'مهرپیکر', 'سمن ناز', 'گرگین', 'داتَه', 'پرند', 'گلنار', 'باتیس', 'ویدا', 'همگون', 'پاکرخ', 'پودینه', 'دِرمنَه', 'آریامنش', 'گل آیین', 'پاک سیما', 'افسر', 'هوفر', 'بوختار', 'ویستا', 'گلزار', 'پاکفر', 'سمیرا', 'مهرپوی', 'آرمیتا', 'سِپِهر', 'اوستانَه', 'اَوَخشیا', 'آرام دخت', 'دلشاد', 'اوشیدر', 'گل آفرید', 'فرزان', 'گل پر', 'آذربُد', 'رادمان', 'هدیه', 'فوگان', 'اَوَرکام', 'گوهر', 'شاددل', 'مهربان', 'آذر بُرزین', 'هوتَخش', 'ارشک', 'مهرآمیز', 'گل شاد', 'فرناز', 'خجیر', 'آذرمهر', 'وِستا', 'دادبه', 'دادرس', 'رام افزون', 'چکاو', 'ماهوش', 'ارشیا', 'شیفته', 'روزبِه', 'دینشاه', 'فروردین', 'فَرهود', 'اَشوداد', 'بایگان', 'اَنوش', 'بُرزو', 'شکربانو', 'سالار', 'نیما', 'دلنواز', 'آبادان', 'گشتاسب', 'شیرین گل', 'هورفَر', 'هورشید', 'سهی', 'گل آور', 'تَنسِر', 'سِپنتا', 'گل پری', 'شهلا', 'خجسته', 'هُووی', 'هُزوارش', 'بَهاوند', 'درمان', 'تاژ', 'گشواد', 'پیروزگر', 'ماهرو', 'پولاد', 'شیروَش', 'یَسنا', 'وَسپار', 'وَسنه', 'شکیبا', 'شاهرو', 'ساحل', 'انوش', 'زادان', 'پاکزاد', 'سامیار', 'ویشتاسب', 'مهرگان', 'آمی‌تیس', 'سیامک', 'نوبخت', 'مَشیانه', 'کیانزاد', 'هور', 'سَلم', 'آدُرباد', 'ناهید', 'آرام', 'شاخه', 'تخشا', 'نینا', 'آشیان', 'هوزاد', 'آرمین', 'مهری', 'خرمدل', 'دیهیم', 'گهربانو', 'نگین', 'یاسمین', 'کیوان بانو', 'خوشدل', 'شاهین', 'نامدار', 'شیرین', 'سیمین چهر', 'کامدل', 'دلاور', 'بوستان', 'اوتانا', 'فُرود', 'باوَند', 'فریبا', 'مهسان', 'خوردخت', 'بَخشا', 'پرشت', 'گوهرسان', 'بَردیا', 'انگبین', 'کوشان', 'اروس', 'آبگینه', 'آژند', 'لاله گون', 'گلی ناز', 'خداداد', 'لبخند', 'تاژ', 'کی بانو', 'خوشنام', 'اَرشَن', 'اَُورنگ', 'باربُد', 'چیستا', 'آذرگون', 'مُوژان', 'آریا', 'گلرخسار', 'هودین', 'آفتاب', 'دیبا', 'شهرام', 'آخشیج', 'زال', 'آذرچهر', 'دل آرام', 'رامین', 'کارن', 'خشاشه', 'هوربانو', 'یزدان یار', 'سداب', 'کاری', 'پرنیان', 'فراتاگون', 'هوشنگ', 'خرامان', 'رپیتون', 'کیهان', 'سودابه', 'اَمُرداد', 'فیروزه', 'پَتَه مانی', 'ترگل', 'پالیز', 'شهداد', 'افروغ', 'چینوَد', 'شهران', 'رَزین', 'نوش', 'ماهان', 'رویا', 'نیکو', 'فروزان', 'چَمان', 'نیکروز', 'آزیتا', 'شباروز', 'زیبا', 'نیکچهر', 'رازیانه', 'اَرشان', 'پریدخت', 'خوبروی', 'اقاقیا', 'فرمنش', 'هوم', 'تابانمهر', 'هامین', 'گیسو', 'اُزیرن', 'هوپاد', 'همدم', 'گل پونه', 'مهرانگیز', 'بَرَسم', 'افشین', 'ماه آفرید', 'آپامه', 'هماچهر', 'هورا', 'نوگل', 'رستم', 'مرمر', 'شیدرخ', 'هارپارک', 'آتروپات', 'آذرافروز', 'واته', 'رخشانه', 'توانا', 'پاکروی', 'شهردخت', 'گل وش', 'رَسادخت', 'بیدار', 'تابانروی', 'فرازمند', 'پژدو', 'بادرام', 'لهراسب', 'شاپور', 'ماهوار', 'نسترن', 'پریوش', 'گاتا', 'پیرایه', 'بی تا', 'هورمهر', 'رادنوش', 'فردخت', 'مینو', 'مهرداد', 'ناشا', 'زیار', 'آستیاک', 'شباویز', 'بهناز', 'جهانگیر', 'آذین', 'پشوتَن', 'رَتوشتَر', 'ایرانپور', 'زیبا دخت', 'شهرنواز', 'رایکا', 'ایرانشاه', 'دَستنبو', 'وهامان', 'رشنواد', 'ایران', 'گلچهر', 'سمنبر', 'گلبو', 'پریچهر', 'دماوند', 'دلدار', 'دیبارخ', 'اشاداد', 'مهشید', 'خُونیرِث', 'مهرافزا', 'پریمرز', 'پردیس', 'باستیان', 'شهیار', 'هومن', 'به‌آفرین', 'آنیتا', 'پاکروان', 'آبتین', 'افسون', 'سمن', 'امیدوار', 'رُهام', 'گرانمایه', 'آرمیتی', 'شکوفه', 'بَرِشنوم', 'هووَرشت', 'بلاش', 'اسفندیار', 'گل نوش', 'آبستا', 'شایگان', 'نیوتیش', 'نیوشا', 'مهیار', 'کیافر', 'مارال', 'روشنک', 'جاوید', 'پری بانو', 'پروین', 'زرین', 'فرهاد', 'فرنام', 'ایرانمهر', 'شایسته', 'وُهومن', 'سیمین دخت', 'گل آرا', 'رودابه', 'شورانگیز', 'فرنگیس', 'ورزم', 'گهر', 'ماهر', 'زیباروی', 'هلیله', 'سوگند', 'زنگه', 'پریرخ', 'مویز', 'شیرزاد', 'نارگون', 'سُرخاب', 'ترنگ', 'اشااونی', 'شهگل', 'پریناز', 'پوروشسب', 'کیواندخت', 'نازبانو', 'آراستی', 'زَهیر', 'گل افسر', 'شهراد', 'گل ربا', 'دینا', 'هرمزدیار', 'نیکرخ', 'کی دخت', 'اسپنتمان', 'گلباد', 'گل سیما', 'آرمیدخت', 'زادمهر', 'تریتی', 'گل بیز', 'پریزاد', 'گوهردخت', 'دلکش', 'گل پیکر', 'دمساز', 'مهرچین', 'دَریز', 'داریوش', 'یاس رخ', 'فراز', 'سمن چهر', 'شاد آفرید', 'مهتاب', 'نکیسا', 'جلبک', 'کشوربانو', 'شتابان', 'نیک پی', 'کاموس', 'چالش', 'دل آرا', 'آژمان', 'تورج', 'رخشنده', 'دادار', 'برسومه', 'دادمهر', 'فروزنده', 'هومان', 'دلپذیر', 'رَشنُو', 'خرم', 'کوسان', 'جان‌پرور', 'نازآفرید', 'خوب چهر', 'نوذر', 'شهریار', 'شادی', 'دادبان', 'شهباز', 'بَرازمان', 'فردین', 'تَندُر', 'شهربانو', 'توراندخت', 'آریامن', 'پیلتَن', 'پیمان', 'برنا', 'سپند', 'تیهو', 'گیسیا', 'شگون', 'ایرج', 'زامیاد', 'بَگاداد', 'نکوزاد', 'فریبرز', 'تیس', 'آذرنوش', 'نیکچهره', 'ارشاسب', 'هوروَش', 'کرکوی', 'شکرناز', 'زرین بانو', 'اَگومان', 'گلپاد', 'وهوگون', 'اشومنش', 'ایران پناه', 'کاوه', 'رایومند', 'زَم', 'انارام', 'رَتوناک', 'اندریمان', 'منیژه', 'داور', 'شادان', 'مهرنگار', 'نامجو', 'کامجو', 'وخش داد', 'کیوانرخ', 'لاله وش', 'وفادار', 'شیدوش', 'دراج', 'گلنام', 'کیان', 'آرامش', 'جام', 'بوخشا', 'فروغبانو', 'مورد', 'رامتین', 'سوسن', 'گل دخت', 'ناز', 'آلاله', 'آونگ', 'تابناک', 'دُغدو', 'گل گونه', 'نوشیروان', 'سالمه', 'گل افشان', 'بدره', 'نگار', 'تیگران', 'درخشان', 'انوشه', 'پاساک', 'خُوروَش', 'اسپهبُد', 'فَرَوَهَر', 'شیددخت', 'پاکیزه', 'کیوانچهر', 'ماندانا', 'زرافشان', 'یزدان داد', 'بهرخ', 'گلستان', 'آتشگون', 'پاکروز', 'نیکنام', 'بخت آفرین', 'هوردخت', 'رامش', 'کاچار', 'گلناز', 'شاهروز', 'فوکا', 'پارمیس', 'کامبیز', 'شیدا', 'اَبیش', 'فرزام', 'اردشیر', 'هوداد', 'آسا', 'تورانبانو', 'مهرآگین', 'هوگون', 'تَسو', 'شکفته', 'سپهرداد', 'اَپروَند', 'تمیس', 'ارد', 'نوید', 'رَخشان', 'آفرین', 'پرچم', 'بهار', 'مِهراب', 'گهرناز', 'اشوچهر', 'خندان', 'دلجو', 'فرخ ناز', 'مهربانو', 'کیومرس', 'هوآفرید', 'رخسار', 'نازمهر', 'گلریز', 'شهین بانو', 'وهشتیه', 'آرتاباز', 'خوشبوی', 'سپیده', 'نیلوفر', 'شادروی', 'بهنام', 'گیو', 'شیان', 'گل چین', 'امید', 'کامیاب', 'مهراسا', 'شهناز', 'گل گون', 'سیمبر', 'وَرَهرام', 'شادبانو', 'کوشیار', 'پریسان', 'هما', 'بِهمرد', 'کاویان', 'همراز', 'ریوند', 'دلگرم', 'گوهرزاد', 'نازنین', 'دهناد', 'گل تن', 'بهاره', 'هوداد', 'نوشین', 'آرتمیس', 'نریمان', 'ردیمه', 'زَریر', 'نازآفرین', 'بهدخت', 'کُنیا', 'کاوش', 'پاکدل', 'پریدخت', 'گلناز', 'نامور', 'تَهمتَن', 'برومند', 'آریوبَرزَن', 'سیاوش', 'پارسا', 'مهستی', 'فروزش', 'بوبار', 'آدُر', 'ژیان دخت', 'شا بهرام', 'چام', 'هورتن', 'ترانه', 'گوهرچهر', 'مه زاد', 'مازنه', 'آوازه', 'فریماه', 'آزادمهر', 'فَرََهمند', 'اردوان', 'پوریا', 'تابنده', 'دلبر', 'البرز', 'ژیان', 'شهروز', 'بهرو', 'دادنام', 'شروین', 'پرویز', 'شادفر', 'هاونی', 'منوشفر', 'شیوا', 'پوپک', 'واج', 'نخستین', 'آریامهر', 'نکویار', 'دانا', 'لادن', 'بُنشاد', 'خوشگو', 'تیرداد', 'کیان پور', 'آدخت', 'گلشن', 'کیقباد', 'مانوش', 'گلبهار', 'بُرزویه', 'مهرمَس', 'زرمان', 'اَپیوه', 'دارا', 'فرامرز', 'خوبرخ', 'بوجه', 'گردآفرید', 'انیران', 'ژاله', 'گل افروز', 'زراندام', 'هوزان', 'زوپیر', 'نوتریکا', 'بهشت', 'مهر رخسار', 'ماه بانو', 'دلاویز', 'زرگیس', 'منوچهر', 'رَنگوشتَر', 'فریان', 'سیروس', 'گل فشان', 'بنفشه', 'یزدان مهر', 'نَستور', 'گلاله', 'فرین', 'اشتاد', 'رازقی', 'دُرنا', 'شب بو', 'دینیار', 'آذرکیوان', 'هامون', 'انوشک', 'زرین چهر', 'توران', 'شادی آور', 'خورشید چهر', 'ایسَدواستَر', 'جانانه', 'شهین', 'ناوَرز', 'شاهدخت', 'کبیتا', 'بامداد', 'مازیار', 'کیوان', 'زرستان', 'آباندخت', 'رسا', 'ورجاوند', 'خسرو', 'چکاوک', 'خشاشه', 'کوروش', 'آذربانو', 'پونه', 'سایه', 'فرانک', 'خوشنوا', 'کشور', 'شباهنگ', 'شادکام', 'توس', 'آتوسا', 'سپیته', 'کامبوزیا', 'زرشام', 'آذربود', 'آتش', 'کیامرد', 'گلاب', 'کیانوش', 'آرش', 'پاکدین', 'پاکچهر', 'دادوَر', 'آراسته', 'هورداد', 'گیتی', 'هنگام', 'نونهال', 'گوهرفشان', 'وخشور', 'هورام', 'پرهام', 'بامگاه', 'گهردخت', 'ایدون', 'اُشهن', 'پارمیدا', 'بهین', 'ماهوار', 'بابک', 'رشن', 'درسا', 'مِهرین', 'ماکان', 'سپیتا', 'رویین تن', 'آرتین', 'پیروزه', 'ارغوان', 'مهرناز', 'زرگیسو', 'گلفام', 'شاد', 'مهرکیش', 'خشایار', 'آذرفر', 'شادبه', 'فروغ', 'فرنوش', 'گوهرشاد', 'فرشاد', 'بَرسام', 'رازمهر', 'هَردار', 'دریا', 'سیمین', 'ماندگار', 'خوشروی', 'خدایار', 'شهنواز', 'کیاندخت', 'نایریکا', 'ارشا', 'تابان', 'داژو', 'کیانفر', 'اوشَه', 'همایون', 'گل دوست', 'یاس گل', 'بینا', 'پری', 'آذر بُرزین', 'سهراب', 'شهزاد', 'ایزد', 'ارج', 'کیمیا', 'افروز', 'مه پیکر', 'اردلان', 'تازه', 'اشوفْرَوَهَر', 'پاکمهر', 'بانو', 'چوگان', 'چالیک', 'نسرین', 'پاکناز', 'دل افروز', 'جالیز', 'وَهمنش', 'دُخمل', 'شیدبانو', 'زیبنده', 'گلشید', 'کیسر', 'رُکسانا', 'سورن', 'شهاب', 'یاسمن', 'اَترس', 'آتری', 'میترا', 'بهمن', 'مه سیما', 'دادخواه', 'گلرنگ', 'شادپری', 'بَختیار', 'خوشه', 'هامان', 'چشمه', 'خورزاد', 'دلپسند', 'ایرانبانو', 'سَپْرَنگ', 'ستایش', 'اشومهر', 'پاکبانو', 'چیستی', 'اشا', 'نارگل', 'ویسپرد', 'کامیار', 'ستاره', 'فربُد', 'پری سیما', 'ماونداد', 'ورساز', 'فرشید', 'گلبان', 'فاتک', 'فرگون', 'شاهرخ', 'سمن روی', 'بَهرامشاه', 'آذرپَژوه', 'نازپرور', 'اَهنَوَد', 'مانی', 'یگانه', 'دلخوش', 'شیشَم', 'بامشاد', 'اروَند', 'جمشید', 'فرزاد', 'کیانا', 'زرین چهر', 'سیمگون', 'اشوزاد', 'پریسا', 'کامروا', 'خردمند', 'کاساندان', 'گهرنگار', 'آزاد منش', 'شادروز', 'جویبار', 'فرخنده', 'بلوت', 'ساسان', 'گل برگ', 'کیارنگ', 'نازیاب', 'مهناز', 'گلنواز', 'هورزاد', 'هوکَرپ', 'جر یره', 'خوشخو', 'گلروی', 'زیباچهر',
);
//echo $names[1255];
function cleanNonAsciiCharactersInString($orig_text)
{
$text = $orig_text;
// Single letters
$text = preg_replace("/[∂άαáàâãªä]/u", "a", $text);
$text = preg_replace("/[∆лДΛдАÁÀÂÃÄ]/u", "A", $text);
$text = preg_replace("/[ЂЪЬБъь]/u", "b", $text);
$text = preg_replace("/[βвВ]/u", "B", $text);
$text = preg_replace("/[çς©с]/u", "c", $text);
$text = preg_replace("/[ÇС]/u", "C", $text);
$text = preg_replace("/[δ]/u", "d", $text);
$text = preg_replace("/[éèêëέëèεе℮ёєэЭ]/u", "e", $text);
$text = preg_replace("/[ÉÈÊË€ξЄ€Е∑]/u", "E", $text);
$text = preg_replace("/[₣]/u", "F", $text);
$text = preg_replace("/[НнЊњ]/u", "H", $text);
$text = preg_replace("/[ђћЋ]/u", "h", $text);
$text = preg_replace("/[ÍÌÎÏ]/u", "I", $text);
$text = preg_replace("/[íìîïιίϊі]/u", "i", $text);
$text = preg_replace("/[Јј]/u", "j", $text);
$text = preg_replace("/[ΚЌК]/u", 'K', $text);
$text = preg_replace("/[ќк]/u", 'k', $text);
$text = preg_replace("/[ℓ∟]/u", 'l', $text);
$text = preg_replace("/[Мм]/u", "M", $text);
$text = preg_replace("/[ñηήηπⁿ]/u", "n", $text);
$text = preg_replace("/[Ñ∏пПИЙийΝЛ]/u", "N", $text);
$text = preg_replace("/[óòôõºöοФσόо]/u", "o", $text);
$text = preg_replace("/[ÓÒÔÕÖθΩθОΩ]/u", "O", $text);
$text = preg_replace("/[ρφрРф]/u", "p", $text);
$text = preg_replace("/[®яЯ]/u", "R", $text);
$text = preg_replace("/[ГЃгѓ]/u", "r", $text);
$text = preg_replace("/[Ѕ]/u", "S", $text);
$text = preg_replace("/[ѕ]/u", "s", $text);
$text = preg_replace("/[Тт]/u", "T", $text);
$text = preg_replace("/[τ†‡]/u", "t", $text);
$text = preg_replace("/[úùûüџμΰµυϋύ]/u", "u", $text);
$text = preg_replace("/[√]/u", "v", $text);
$text = preg_replace("/[ÚÙÛÜЏЦц]/u", "U", $text);
$text = preg_replace("/[Ψψωώẅẃẁщш]/u", "w", $text);
$text = preg_replace("/[ẀẄẂШЩ]/u", "W", $text);
$text = preg_replace("/[ΧχЖХж]/u", "x", $text);
$text = preg_replace("/[ỲΫ¥]/u", "Y", $text);
$text = preg_replace("/[ỳγўЎУуч]/u", "y", $text);
$text = preg_replace("/[ζ]/u", "Z", $text);
// Punctuation
$text = preg_replace("/[‚‚]/u", ",", $text);
$text = preg_replace("/[`‛′’‘]/u", "'", $text);
$text = preg_replace("/[″“”«»„]/u", '"', $text);
$text = preg_replace("/[—–―−–‾⌐─↔→←]/u", '-', $text);
$text = preg_replace("/[ ]/u", ' ', $text);
$text = str_replace("…", "...", $text);
$text = str_replace("≠", "!=", $text);
$text = str_replace("≤", "<=", $text);
$text = str_replace("≥", ">=", $text);
$text = preg_replace("/[‗≈≡]/u", "=", $text);
// Exciting combinations
$text = str_replace("ыЫ", "bl", $text);
$text = str_replace("℅", "c/o", $text);
$text = str_replace("₧", "Pts", $text);
$text = str_replace("™", "tm", $text);
$text = str_replace("№", "No", $text);
$text = str_replace("Ч", "4", $text);
$text = str_replace("‰", "%", $text);
$text = preg_replace("/[∙•]/u", "*", $text);
$text = str_replace("‹", "<", $text);
$text = str_replace("›", ">", $text);
$text = str_replace("‼", "!!", $text);
$text = str_replace("⁄", "/", $text);
$text = str_replace("∕", "/", $text);
$text = str_replace("⅞", "7/8", $text);
$text = str_replace("⅝", "5/8", $text);
$text = str_replace("⅜", "3/8", $text);
$text = str_replace("⅛", "1/8", $text);
$text = preg_replace("/[‰]/u", "%", $text);
$text = preg_replace("/[Љљ]/u", "Ab", $text);
$text = preg_replace("/[Юю]/u", "IO", $text);
$text = preg_replace("/[fifl]/u", "fi", $text);
$text = preg_replace("/[зЗ]/u", "3", $text);
$text = str_replace("£", "(pounds)", $text);
$text = str_replace("₤", "(lira)", $text);
$text = preg_replace("/[‰]/u", "%", $text);
$text = preg_replace("/[↨↕↓↑│]/u", "|", $text);
$text = preg_replace("/[∞∩∫⌂⌠⌡]/u", "", $text);
//2) Translation CP1252.
$trans = get_html_translation_table(HTML_ENTITIES);
$trans['f'] = '&fnof;'; // Latin Small Letter F With Hook
$trans['-'] = array(
'&hellip;', // Horizontal Ellipsis
'&tilde;', // Small Tilde
'&ndash;' // Dash
);
$trans["+"] = '&dagger;'; // Dagger
$trans['#'] = '&Dagger;'; // Double Dagger
$trans['M'] = '&permil;'; // Per Mille Sign
$trans['S'] = '&Scaron;'; // Latin Capital Letter S With Caron
$trans['OE'] = '&OElig;'; // Latin Capital Ligature OE
$trans["'"] = array(
'&lsquo;', // Left Single Quotation Mark
'&rsquo;', // Right Single Quotation Mark
'&rsaquo;', // Single Right-Pointing Angle Quotation Mark
'&sbquo;', // Single Low-9 Quotation Mark
'&circ;', // Modifier Letter Circumflex Accent
'&lsaquo;' // Single Left-Pointing Angle Quotation Mark
);
$trans['"'] = array(
'&ldquo;', // Left Double Quotation Mark
'&rdquo;', // Right Double Quotation Mark
'&bdquo;', // Double Low-9 Quotation Mark
);
$trans['*'] = '&bull;'; // Bullet
$trans['n'] = '&ndash;'; // En Dash
$trans['m'] = '&mdash;'; // Em Dash
$trans['tm'] = '&trade;'; // Trade Mark Sign
$trans['s'] = '&scaron;'; // Latin Small Letter S With Caron
$trans['oe'] = '&oelig;'; // Latin Small Ligature OE
$trans['Y'] = '&Yuml;'; // Latin Capital Letter Y With Diaeresis
$trans['euro'] = '&euro;'; // euro currency symbol
ksort($trans);
foreach ($trans as $k => $v) {
$text = str_replace($v, $k, $text);
}
// 3) remove <p>, <br/> ...
$text = strip_tags($text);
// 4) &amp; => & &quot; => '
$text = html_entity_decode($text);
// transliterate
// if (function_exists('iconv')) {
// $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
// }
// remove non ascii characters
// $text = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $text);
return $text;
}
function returnValidPersian($text)
{
$regex = '[^0-9آ-ی]';
return trim(mb_ereg_replace($regex, '', $text));
}
function getSade($url, $time = 30)
{
$url = str_replace(' ', '%20', trim($url));
$list = array(
'Googlebot/2.1 (+http://www.google.com/bot.html)'
);
shuffle($list);
$list = $list[0];
$refer = array(
'https://www.google.com',
'https://www.instagram.com',
'https://www.facebook.com',
'https://i.facebook.com',
'http://www.payvandha.ir',
'https://forum.prsiantools.com'
);
shuffle($refer);
$ref = $refer[0];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_REFERER, 'https://www.google.com');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $time);
curl_setopt($ch, CURLOPT_TIMEOUT, $time);
curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
$result = curl_exec($ch);
$getinfo = curl_getinfo($ch);
curl_close($ch);
// echo "http_code:" . $getinfo['http_code'] . "\n";
if ($getinfo['http_code'] != 200)
return false;
return $result;
}
function is_mobile($val)
{
$val = strtr($val, array('۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4', '۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9', '٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4', '٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9'));
if (preg_match("/^(\+98|98|0098|0)?9\d{9}$/", $val)) {
return true;
} else {
return false;
}
}
function mobileStandard($number){
$lenght = strlen($number);
if($lenght===10)
$exp = $number;
else if($lenght>10) {
$start = $lenght-10;
$exp = substr($number, $start);
}
else
return false;
return '98'.$exp;
}
function tt($v){
return trim($v);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment