You Are Viewing Posts Under Category: PHP Codes

How-To-Get-Remaining-Days,-Hours,-Minutes-And-Seconds-From-A-Date-Using-PHP

How To Get Remaining Days, Hours, Minutes And Seconds From A Date Using PHP?

Today, we will learn to calculate the time remaining till future dates in days, hours, minutes and seconds. Either you are receiving values in the PHP variable from the MySQL database, or you are calling an AJAX request, this tutorial will help you in both situations. We will also display the hours,...
How-To-User-Get-Location-Details-Using-Pure-PHP

How To User Get Location Details Using Pure PHP?

Detecting the location of your users can be really useful if you want to personalize your user’s experience when they browse through your website. Want to show a uniquely tailored promotion? Want to change the language of your site or design based on where your users are coming from? Lots of websi...

How To Clean Or Sanitize String For File Name With Standards Using PHP?

Are you trying to come up with a function that does a good job of sanitizing certain strings so that they are safe to use in the URL (like a post slug) and also safe to use as file names? For example, when someone uploads a file I want to make sure that I remove […]...
Image-Color-Extract-Using-Simple-PHP-Without-Composer

Image Color Extract Using Simple PHP Without Composer

Have you ever wondered what kind of colours you should get to match your logo for your website? Here’s a very simple script that generates a colour palette for an image using the PHP GD library. This will help you find out which colours you can use to improve the quality of your site. The [&he...
How-To-Import-CSV-Files-Using-PHP-To-MySQL

How To Import CSV Files Using PHP To MySQL?

After knowing How To Export MySQL Database Tables To CSV Format Using PHP? its time to know about How To Import CSV Files Using PHP To MySQL?. The import and export of data to and from databases are a common enough procedure in PHP development. Another important activity is the backup and transfer o...
How-To-Export-MySQL-Database-Tables-To-SQL-Format-Using-PHP

How To Export MySQL Database Tables To SQL Format Using PHP?

The database backup is the most important task for every web developer. Regular database backup prevents the risk to lose the data and it helps to restore the database if any issue occurred. So, Export MySQL Database Tables whenever possible is a good idea. It is always good practice to take a regul...
How-To-Export-MySQL-Database-Tables-To-Excel-XLS-Using-PHP

How To Export MySQL Database Tables To Excel XLS Using PHP?

Export MySQL Database Tables is a familiar operation for many of us. phpMyAdmin is the go-to choice for a database client in PHP. It provides database administration tools and also allows Exporting MySQL Database Tables. The exported data can be in various formats like SQL, CSV as selected. This tut...