Display PHP Version

Display PHP Version

PHP provides different versions with different features. The latest PHP version is 7.4 as writing this post. Different versions of the PHP deployed in different platforms. The phpversion() function can be used to print currently running PHP version. phpversion() Function Syntax The phpversion() function syntax is like below. The EXTENSION parameter is optional and if … Read more

PHP str_replace() Function Tutorial

PHP str_replace() Function Tutorial

PHP provides the str_replace() function in order to replace characters or strings in a string. The str_replace() function can be also used to search in an array and replace string too. The replacement of the string occurs in every array element. The str_replace() function is case sensitive function where the uppercase and lowercase characters or … Read more

PHP Associative Arrays Tutorial

PHP Associative Arrays Tutorial

PHP programming language provides arrays in order to store multiple items in a single variable. Arrays are very useful which makes the storage, management, and manipulation of series of data easy. The PHP provides associative arrays which is a type of array. Associative arrays are used to store items as values and keys. The associative … Read more

PHP exec() – Execute Commands and Programs

PHP exec() - Execute Commands and Programs

PHP provides the exec() method in order to execute or run commands, programs, or scripts. This exec() method can simply execute external commands in the operating system. For example, the whoami command of Linux can be executed for the current user, and returned username can be used in PHP applications. The exec() Method Syntax The … Read more

array_push() and array_merge() – Append Into Array In PHP

array_push() and array_merge() - Append Into Array In PHP

PHP provides the array in order to store multiple items in a single variable. Array items can be provided during the array definition but can be also added later by using the array_push() method. In this tutorial, we will learn how to append new items into an array. array_push() Syntax The array_push() method has the … Read more

Encode JSON with json_encode() In PHP

Encode JSON with json_encode() In PHP

JavaScript Object Notation or JSON is a simple data-interchange format that is created openly. Today a lot of applications use JSON to transfer data between server and client. As a server-side programming language PHP provides JSON related functions. In order to encode a JSON data the json_encode() function is provided by PHP. PHP uses the … Read more

How To Install PHP In Ubuntu, Debian, Mint?

How To Install PHP In Ubuntu, Debian, Mint?

PHP is popular programming and scripting language which is created 30 years ago it gained popularity with the web and mainly used to create web applications. Even the PHP provides support for different platforms and libraries the main usage is creating web applications. Linux and especially Ubuntu is popular distributions for web servers. PHP applications … Read more