Welcome back to shortlearner.com, in this post today we will see how to find user’s location with having their IP address. so most of the time we need to access the user’s location to analysis the location wise client base. In the below PHP script first of all we will fetch the user’s IP address by using pre-defined PHP function and store the IP address in a $ip_address variable.
so simply we will pass this IP address to our third party platform that will return as a JSON array that having country, country code, state, city , zip, time zone, longitude and latitude as well. here we are performing this task with the help of curl functionality.
Welcome back to shortlearner.com , today in this post we will see how to find the age of the user on the basis of their date of birth. so we are going to write a program in php that will help us to calculate age.
//date in mm/dd/yyyy format; or it can be in other formats as well
$birthDate = "12/17/1983";
//explode the date to get month, day and year
$birthDate = explode("/", $birthDate);
//get age from date or birthdate
$age = (date("md", date("U", mktime(0, 0, 0, $birthDate, $birthDate, $birthDate))) > date("md")
? ((date("Y") - $birthDate) - 1)
: (date("Y") - $birthDate));
echo "Age is:" . $age;
in the below program we are declared a variable $birthDate with having a date in mm/dd/yyyy format. after that we are using predefined php function explode(), so with the help of that function we will explode the date to get month ,date and year as well. after that we will calculate the age of user on the basis of user’s date of birth and current date.
Welcome back to shortlearner.com, today in this post we will see how to integrate ckeditor in our web based projects. so before start the integration we should take an small overview and knowing the amazing benefits and features of CKeditor. most of the time we need an editor that will help us to bold, italic and underline the paragraph and also help us to upload multiple images with in the paragraph.
so before start this tutorial we should take an overview of the scenario of the post. we are designing a responsive signup form with username, email and multiple file options with the help of HTML, CSS and Bootstrap.