Hello, welcome to my another blog post how to detecting Mobile and Tablet users using PHP and redirect them accordingly. Today I will show you how to detect your website visitors device and then do your steps accordingly. If you create two sites, one for a desktop user and another one is for mobile and tablet user, this script will do the redirection job for you. Here I create two simple functions, one for mobile device and another one is for a table. Both functions check the visitor browser type and give you information about user device. Read more
Hello friend, welcome to my blog post how to calculate a distance between two lat long points PHP. Today I will give you a very interesting script to calculate a distance between two lat long. If you want to create listing and searching website like www.groupon.com or this types of websites you need this code. Using this code you can show the distance between customer and service provider or filter your area within a distance. Using the visitor IP address you can get visitor latitude, longitude and using service provider address you can get the latitude and longitude of the service provider. The using the below function you can get exact distance between to location. Read more
Hello friends, welcome to my another blog. Today I will show you how to find the number of days between two days except weekends in PHP. If you are creating an employee management application or leave management application you need to calculate a total number of working days except weekends between two days. Using the below script you can calculate the number of days between two days except weekends. So lets began. At first, I create a simple function to calculate the number of days between two days, then I will modify the function and make it work for our application. Read more
Hello friends, welcome to my another blog post get user details from IP Address using PHP. Using this small application you can get visitor’s country, state and geographic location. The concept behind this application is that when a user visit to your website you can easily get the IP address of that user using $_SERVER[‘REMOTE_ADDR’]. Just store the IP address into a variable and pass that IP into third party websites API. This third party API will give you all the information related to that IP address. Read more
Hello friends, welcome to my another blog post how to remove the file extension from URLs using htaccess file. If you want to make your website URLs more user and search engine friendly then it is very important to remove file extension like .php, .html, .htm from your site URL. In this blog post I will show you how to remove file extension from URLs using htaccess. Read more
Hello friends, welcome to my another blog post check multiple value exists in array using PHP. In my anothertutorial I show you how to check value exists in array php. But that code does not allow to check multiple value exists in array. But if you want to check multiple values exists in an array then what to do. There is a multiple options for you. You can create your own function, search in google or use my function. In this post I will create a custom function my_custom_function which will do the trick for you. Read more
Hello friends, welcome to my new blog post send html email in php. In my previous few post I gave you some OpenCart tips. But today I will tell you how to send html email in php. PHP has a built in mail function by which we can sent mail to anybody from our server. But when we sent mail to someone we have to care full about our mail content as well as mail design. If we sent a mail with proper look and html design using php then we need to put some additional code to support html in our mail. Read more
Hello, friends in my previous post I show you an opencart trick but in this post I will show you all types of php validation script for input fields. Here I create a specific function for every types of validation like email address, name, url, zip code, USA zip code, UK zip code, social security number, international phone number, US phone number, Indian phone number, Read more
Hello friends, In my previous tutorial I show you how to export SQL result to XML file. But today I will show you how to import xml into mysql database using PHP. Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format which is both human-readable and machine-readable. Suppose you have a XML file with some data. Now you need to get the data from that xml file and save the data into a database table for future use. f you have this type of requirement then using the below script you can import value from any xml file into your database table. You just create the table before import data into it.
Hello friends, today I will show you how to export SQL result to XML file in PHP. When we are working with any SQL result set it gives us one or many rows. We use this result in our application. But when you fetch rows using sql but instead of showing result if you need to store the result set for future use or any other reason, you may use xml file to store the result set. So I build a code to export sql result to xml in PHP.