In this post, we will provide a quick and easy method to determine the length of a PHP array.We will present a simple example of how to calculate the length of an array in PHP. How to get Array Length…
Category: PHP
Get Duplicate Values from an Array in PHP
In this post, we will explore how to identify duplicate values in a PHP array. We’ll provide you with an example of how to retrieve duplicate values from an array in PHP. Get Duplicate Values from an Array in PHP…
Check If An Array Has Duplicate Values Example in PHP
In this simple tutorial I shall illustrate how to check whether a PHP array has duplicated values. In this simple example we will process an array to detect identical or duplicate values. If you want to detect duplicate values within…
PHP example of Null coalescing operator for shorthand If-Else operator
In this example we will see the use of the shortest shorthand of if-else statement to check isset variable in PHP programming language. Using Null coalescing operator we can write shortest if-else statement to check isset value and return it…
How to use cURL in PHP, Working examples of cURL in PHP
What is cURL? cURL is a computer software project providing a code library (libcurl) and command-line tool (curl) for transferring data using various network protocols. Usually PHP comes loaded with libcurl library by default. Check if cURL is enabled in…
How to check if a string is a valid JSON object in PHP
You receive a data in form of string and it is supposed to be a valid JSON. So how to know whether a string you have is a valid JSON object. Here in this post I will show it with…
Array Destructuring With or Without List Function in PHP
Have you been unwillingly using the useful “extract” function to convert array elements into their corresponding names with same variable name as the key of the array element? Have you been worrying about the non-friendly nature of your code for…
Creating Custom Shortcode in WordPress
With a lot of customization with the theme WordPress also provide us to create our own Custom Shortcode. Basically, shortcodes are the small piece of code which let user to add dynamic content in WordPress posts, pages or sidebar widgets.…
file_get_contents(): SSL operation failed with code 1 certificate verify failed
I got this error when I moved a site to new server. It was a simple file_get_contents() call to read an image file. If i copy pasted the url of the same file to open in browser it would open…
How to know the location of a function defined in PHP
Sometimes you want to know the location of a function defined in your php application. For example you are debugging a large online web application or website. To continue debug you want to enter into a function to debug. You…