A lot of programs, both big and small, require us to deal with numbers. There are two ways of defining numbers in PHP. They can either be floats or integers. We can also use strings to represent very large numbers. You can learn more about these data types and converting between them in this tutorial… Continue reading PHP round, ceil, and floor: Which One to Use?
Tag: PHP
Which Back-End to Choose? Node.js vs PHP
In this article, we’re going to discuss PHP and Node.js: two popular back-end technologies for web applications. We’ll discuss the key differences between them to help you choose the right back-end technology for your next project. Introduction First of all, let’s go through what exactly these two back-end technologies are and what they are used… Continue reading Which Back-End to Choose? Node.js vs PHP
How to Increase max_execution_time in PHP
In this quick article, we’ll explore the different options that allow you to increase the maximum amount of time a script is allowed to run before it’s terminated by a the parser in PHP. What is the max_execution_time Directive in PHP? The max_execution_time directive sets the maximum amount of time a script is allowed to… Continue reading How to Increase max_execution_time in PHP
Anonymous and Arrow Functions in PHP
I’ve already covered the basics of functions in PHP in one of a previous tutorials. Even though PHP has a lot of built-in functions, it gives us the choice to define our own functions as well. There are different ways to define our own functions in PHP. PHP Functions in PHP: Return Values and Parameters… Continue reading Anonymous and Arrow Functions in PHP
How to Work With Regular Expressions in PHP
In this article, we’ll go through the PHP functions that allow you to use regular expressions to perform search and replace operations on strings. What Is a Regular Expression? Regular expressions—also called “regex”—are search patterns for text. These patterns can be processed by a regex engine to find substrings, validate that a string matches a… Continue reading How to Work With Regular Expressions in PHP
What is PHP Used For?
PHP is an open source language that was created to make web development easier. It’s primary and most suitable purpose is as a web development language for creating web apps or APIs. You don’t need a complicated set of commands to create webpages in PHP. In fact, you can mix PHP with plain HTML in… Continue reading What is PHP Used For?
PHP Superglobals Explained—With Cheatsheet
In this post, I’ll give you a cheatsheet quick reference to all the PHP superglobal variables available in PHP. What Is a Superglobal Variable? Let’s have a look at the definition of superglobal variables. Superglobals are built-in variables that are always available in all scopes. Whether you are a seasoned PHP developer or a novice… Continue reading PHP Superglobals Explained—With Cheatsheet
8 Best Free Live Chat PHP Scripts
Are you thinking of adding a free live chat feature to your website? Do you want to give personalized live chat support that will improve your visitors’ website experience? Do you want your forum members to chat with each other in real time? Fortunately, there are free PHP scripts available to help. Free PHP live… Continue reading 8 Best Free Live Chat PHP Scripts
How to Use cURL in PHP
Today, we’re going to explore the cURL extension in PHP which allows you to make HTTP requests from your code. Often you need to communicate with external websites in your day-to-day PHP development. Whether it’s calling third party REST APIs to fetch data or downloading resources from the external website, you want a library which… Continue reading How to Use cURL in PHP
Understanding Variable Scope in PHP
Variables are an important part of any programming language. You can use them to store all kinds of information like integers, floats, strings, arrays, the contents of a file, etc. The data stored in variables can then be manipulated by adding or removing information. Using variables also allows us to create loops and perform some… Continue reading Understanding Variable Scope in PHP
Quick Tip: Add a Formspree Form to Your Static Sites
In this tutorial we’re going to use Formspree for a hassle-free way of adding dynamic, flexible forms to your static websites. The Problem: Contact Forms Imagine you’ve just created a website using static pages, whether that be with the aid of Jekyll, Eleventy, Gatsby or merely using some HTML files, but you now want to add a contact form.… Continue reading Quick Tip: Add a Formspree Form to Your Static Sites
How to Check if a String Contains Another Substring in PHP
A lot of times when I am working with strings in PHP, it becomes important to check if a string contains another substring. PHP has a lot of functions to help you manipulate strings any way you like. We will be using some of these functions today to learn how to check if a string… Continue reading How to Check if a String Contains Another Substring in PHP
Example of How to Add Google reCAPTCHA v3 to a PHP Form
In this article, I’m going show you how to add Google reCAPTCHA v3 to a form on your PHP website. The latest reCAPTCHA is different than the previous versions—it doesn’t require user interaction at all. In this post, we’ll see how it works, and we’ll build a real-world example for demonstration purposes. As a website… Continue reading Example of How to Add Google reCAPTCHA v3 to a PHP Form
How to Make a Live Chat Script in PHP
In this article, we’ll discuss how you can make a live chat script in PHP. Although there are different ways you could achieve this, we’ll use a socket-based implementation. If you’re building a community site which involves user engagement, it’s useful to provide a way for users to discuss ideas in real time. When it… Continue reading How to Make a Live Chat Script in PHP
10 Best PHP Chat Scripts on CodeCanyon
Do you want to provide real time, instant solution to your customers most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your customers. Live chats also allow users in an online community to chat with each other in real… Continue reading 10 Best PHP Chat Scripts on CodeCanyon
11 Best PHP Blog Scripts and Blogging Platforms
Are you looking to start an independent blog or add a business blog to your website? Blogs are the most reliable means of growing a business and boosting revenue. They are the best way of letting visitors know what your business is about. In addition to help you generate leads, blogs build trust in existing… Continue reading 11 Best PHP Blog Scripts and Blogging Platforms
Functions in PHP: Return Values and Parameters
Functions are an important part of programming languages. They help us avoid code duplication by allowing us to run the same set of instructions over and over again on different data. In this tutorial, we will talk about functions in PHP. We will cover all the basic concepts of functions in PHP, and you’ll learn… Continue reading Functions in PHP: Return Values and Parameters
How to Work With Cookies in PHP
You might have heard about cookies, but what exactly are they and what can we actually do with them? In this tutorial, we will focus on the basics of cookies, and learn about their functionality in various web applications and site environments. We will also learn how to work with cookies in PHP. Cookies vs… Continue reading How to Work With Cookies in PHP
String Concatenation in PHP
String concatenation is a very common and useful operation in PHP. There are many ways in which you might want to join strings together like prepending, appending, or combining them at some other point. In this quick tip, I’ll teach you string concatenation in PHP. You’ll learn how to prepend or append strings in PHP… Continue reading String Concatenation in PHP
How to Trim Strings in PHP
There are a lot of times when we want to work with strings but they are padded with unwanted characters either at the beginning or the end. PHP has defined specific functions that we can use to trim such strings easily. In this quick tip, we will discuss to common string trimming situations that you… Continue reading How to Trim Strings in PHP
How to Create a Thumbnail Image in PHP
Today, we’ll discuss how you could create thumbnail images in PHP with the help of the GD library. When you’re working on projects that are related to media, more often than not you will need to create thumbnails from the original images. Also, if you’ve enabled image uploads on your website, it’s essential that you… Continue reading How to Create a Thumbnail Image in PHP
How to Send Text Messages With PHP
Text messaging has become extremely widespread throughout the world—to the point where an increasing number of web applications have integrated SMS to notify users of events, sales or coupons directly through their mobile devices. If you’re looking to grow your business, a PHP text message script can be crucial. In this tutorial, you’ll learn how… Continue reading How to Send Text Messages With PHP
How to Create a Simple Web-Based Chat Application
In this tutorial we will be creating a simple web-based chat application with PHP and jQuery. This sort of utility would be perfect for a live support system for your website. Otherwise, learn how to build one yourself in this tutorial. This tutorial was updated recently to make improvements in the chat app. Introduction The… Continue reading How to Create a Simple Web-Based Chat Application
How to Paginate Data With PHP
I can remember years ago, when I first began coding in PHP and MySQL, how excited I was the first time I got information from a database to show up in a web browser. For someone who had little database and programming knowledge, seeing those table rows show up onscreen based on the code I… Continue reading How to Paginate Data With PHP