AD to BS Coverter [ Nepali to English Date Conveter] [PHP]

Want a PHP Class for Converting AD-BS & BS-AD. Download the file  Download Now!! class.bs-ad.phps  (Imp. rename it to class.bs-ad.php)  and Write the following to use the library

<?php
require_once("class.bs-ad.php"); //downloaded and renamed class file
$ad_bs = new NepaliCalender();
$oz_date = array("oz_year"=>1996,"oz_month"=>06,"oz_day"=>16); //My Birthday :D
$oz_gotBS = $ad_bs-> ad_2_bs($oz_date['oz_year'],$oz_date['oz_month'],$oz_date['oz_day']);
if(is_array($oz_gotBS))
{ echo $oz_gotBS["year"]; echo $oz_gotBS["month"]; echo $oz_gotBS["date"]; echo $oz_gotBS["day"]; echo $oz_gotBS["nmonth"]; echo $oz_gotBS["num_day"];
}
?>
<?php
require_once("class.bs-ad.php"); //downloaded and renamed class file
$ad_bs = new NepaliCalender();
$oz_date = array("oz_year"=>2053,"oz_month"=>03,"oz_day"=>02); //Again My Birthday :D
$oz_gotAD = $ad_bs-> ad_2_bs($oz_date['oz_year'],$oz_date['oz_month'],$oz_date['oz_day']);
if(is_array($oz_gotAD))
{ echo $oz_gotAD["year"]; echo $oz_gotAD["month"]; echo $oz_gotAD["date"]; echo $oz_gotAD["day"]; echo $oz_gotAD["nmonth"]; echo $oz_gotAD["num_day"];
}
?>

Hope This Helps you 🙂

 

Nepali Phone Number Validator Javascript [JS+PHP]

Many nepali online sites have form to insert phone number in them.In this example i am going to show how to validate Nepali Phone Number [Ncell,NTC,Sky,Smart] Mobile phone number using Js Regex

/* elem means input object whose email data is to be validated */
function phoneValidator(elem)
{	var phoneExp = /^9+([7-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]+)/;	if(elem.val().match(phoneExp) && elem.val().length==10)	{	return true;	}	else	{	return false;	}
}

Place this in your Js Submission page for Clent side Validation and PHP Validation via

<?php
function check_mail_addr($input_email=""){ if(preg_match("//^9+([7-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]+)//", $input_email)) { return true; }
}
?>

        

Zone 2 District PHP Code Nepali

zone_2_district

Try Zone District Selector that loads the name of district of Nepal when the Patricular zone is Selected 🙂

This code is simple to Learn and Understand

Try it Now

Try it Now!!!

Downlload Now!!

Download