How to check an array is multidimensional or not in PHP?

How to check an array is multidimensional or not in PHP?

Sometimes we need to check the array is multidimensional or not in the PHP. In this tutorial, we will learn different ways to check multidimensional array. In this tutorial, we will discuss and check if array is multidimensional or not in PHP. We will look at example of PHP check array is multidimensional. We would like to share with you how to check if array is multidimensional PHP. Let's suppose...
How to access PHP variables in JavaScript or jQuery

How to access PHP variables in JavaScript or jQuery

Sometimes we need to access the PHP variables in javascript or jquery for the use in the application. In this article, let’s see how to pass data and variables from PHP to JavaScript. If you have a simple string value in PHP and you want to access that value in javascript or jquery then you have two options to do so. First, we can pass the data through cookies. In...
Compress Image Before Upload using PHP

Compress Image Before Upload using PHP

Large image size always takes time to load a web page. We always need to upload compress images to the server, If you want to load a large image without affecting the page load time, then the images on the page need to be optimized. When we make the web application we always have to make sure that the images should be well compressed so that it does not affect...
How to get a random key from a PHP array

How to get a random key from a PHP array

In this post, we will explain to you how to get a random value from the PHP array. We know that array is an essential part of any programming language and we required array in many conditions in the project to get the job done. Without an array managing the things inside the project is very tough. Sometimes we encounter a situation where we need to get a random value...
How to create a zip file and download multiple files using ZipArchive?

How to create a zip file and download multiple files using ZipArchive?

In this PHP Tutorial, we are going to explain to you How to create a zip file and download multiple files using ZipArchive? In this example, we will use open()  method to open or create any zip file and addFile() method is used to add files to archive and close() method is used to close the zip file safely. ZipArchive is a PHP class that has many useful static functions to use. ZipArchive can be...
How to generate PDF file using PHP and MPDF library

How to generate PDF file using PHP and MPDF library

There are several situations when we need to save the data in PDF in the application. For example, generate an invoice or generate a book in PDF files. In this post, we will learn How to generate PDF files using PHP and MPDF library. Using PHP we can generate PDF file easily. There are many PDF libraries we can use to generate PDF. But in this tutorial we will show...
How to Convert a String to Array Using PHP Without Explode Function?

How to Convert a String to Array Using PHP Without Explode Function?

We always encounter a situation where we need to convert a string to array. We can easily do the same with the help of explode() method in PHP, but what if we need to do the same thing without the use of explode() method. PHP has many useful built-in functions, and I think that makes it very easy to use and user friendly. You will get built-in string functions for...
How to block IP addresses from accessing the application

How to block IP addresses from accessing the application

Middleware is a kind of rule which we enforce as per our requirement. Laravel has built-in middleware like Auth. We can create our own middleware as per the requirements and rules and block IP addresses from accessing the application. Sometimes we need to validate the IP address in the application. We know that these days DDoS attacks are common on servers. Though most of the hosting provider provides the DDoS...