Simple HTML parser using PHP
A simple PHP HTML DOM parser written in PHP5+, supports invalid HTML, and provides a very easy way to find, extract and modify the HTML elements of the DOM. jQuery like syntax allow sophisticated finding methods for locating the elements you care about.…
Random Quotes Generator using PHP API
The following source code demonstrates a simple PHP API to get random quote. We simply need to make a GET request to the API endpoint : https://api.quotable.io/random and we will get a random quote in response. Full Source Code : <?php $api_url =…
QR Code Reader using PHP Library
In this article, we are going through a PHP library to detect and decode QR-codes. Installing QR Code Reader/Decoder PHP Library The recommended method of installing this library is via Composer. We need to run the following command from the project…
Convert Number into words using PHP
In this article, we are going to learn to convert number into words using PHP. We have a PHP function which simply returns the word for the corresponding numeric value passed to it. PHP Function to convert number into words <?php function…
Prevent Too Many Request From a Client using PHP
In certain scenarios, we might need to make sure that a client is not allowed to request a page for multiple number of times within a period of time. The following sample PHP code exits the execution when a client requests the same page more than once…
Extract all Links from a Webpage using PHP
The following is a simple PHP script to extract all links from a webpage : <h1 style="text-align:center;">Extract All Links from a Webpage using PHP</h1> <hr> <?php function getAllLinks($url){ $urlData = file_get_contents($url); $dom…
Generate User Avatar with Name using PHP
In computing, an avatar (also known as a profile picture or userpic) is a graphical representation of a user or the user’s character or persona. It may take either a two-dimensional form as an icon in Internet forums and other online communities or…
Social Media Link Preview using PHP
Social Medias today are one of the major source of traffic to web applications and websites. URL sharing in social media platforms like Facebook, Twitter, Instagram, Viber and others are used extensively to drive traffic to websites or other…
Free Sending Emails with PHP
Email has become one of the integral part of our daily process in recent years. Especially to business or corporate houses, emails are widely used for communication and marketing purposes. In this article, we are going to learn to send emails using PHP.…
Get Client IP Address using PHP
The simplest way to get the IP address of client with PHP is using the $_SERVER[‘REMOTE_ADDR’] or $_SERVER[‘REMOTE_HOST’] variables. However, sometimes this does not return the correct IP address of the visitor, so we can use some…
Build a simple Calendar in Website using PHP (With Source Code)
A Calendar is a chart or series of pages showing the days, weeks, and months of a particular year, or giving particular seasonal information. In this article, we will be learning to design and develop a Calendar for a webpage using PHP. Files :…
Upload Files in Chunk using PHP and JavaScript
Often, we need users to upload files via a webpage. There’s not much challenge if the file is a simple text file or a small image file. The real challenge arises when there’s a big files (zip or videos or any other). In this article, we will…
How to Zip/Unzip files using PHP
Compressing files while transferring from one location to other is always a good option. In case of web experience, compressing files means reducing the file size by nice margin resulting in low bandwidth consumption as well as faster download and upload…
Hangman Game in PHP : Complete Source Code
Hangman is a paper and pencil guessing game for two or more players. One player thinks of a word, phrase or sentence and the other(s) tries to guess it by suggesting letters within a certain number of guesses. Complete Source Code config.php <?php…
How to run a Linux command in background ?
Running a command in the background can be useful when the command will run for a long time and does not need supervision. It leaves the screen free so you can use it for other work. In addition, it doesn’t stop the next processes or commands in…