In this article, we will see how to create an array for the JSON in PHP, & will see its implementation through examples....
We have given a variable and the task is to check whether the value of given variable is null or not and returns a Boolean value using PHP. To check a variable is null or not, we use is_null() function. A variable is considered to be NULL if it does not store any value. It returns TRUE if value of variable $var is NULL, otherwise, returns FALSE....
Use strtotime() function to get the first day of week using PHP. This function returns the default time variable timestamp and then use date() function to convert timestamp date into understandable date....
Given an XML document and the task is to convert an XML file into PHP array. To convert the XML document into PHP array, some PHP functions are used which are listed below:...
Overview: To obtain the details like country, continent, city, etc of the visitor, first we need to get the IP of the visitor. The IP address can be obtained with the help of superglobal $_SERVER in PHP. Finally, with the use of API geoPlugin, we can obtain information about the IP address i.e. visitor of the website....
If you are a newbie in the field of software development, the very first question comes to your mind is “Where to begin?” That’s undoubtedly true!...
Sorting a multidimensional array by element containing date. Use the usort() function to sort the array. The usort() function is PHP builtin function that sorts a given array using user-defined comparison function. This function assigns new integral keys starting from zero to array elements....
Given a number in string format and the task is to remove all leading zeros from the given string in PHP....
Existence of an URL can be checked by checking the status code in the response header. The status code 200 is Standard response for successful HTTP requests and status code 404 means URL doesn’t exist....
Given an array of objects and the task is to sort the array by object by given fields....