You are here: Home / Topics / Page / 1

How to sort elements of an array in descending order in PHP?

By Vinay Kumar on 19 Nov 22 | Filed under: PHP
The below program is to sort elements of an array in descending order using PHP sort() function. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time.sort() function in PHPExample<!DOCTYPE html><html>&l

Program to find the sum of elements in an Array in PHP

By Vinay Kumar on 19 Nov 22 | Filed under: PHP
The below program is to find the sum of elements in an array. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time.array_sum() function in PHP Example<!DOCTYPE html><html><body><?php  

How to find the product of elements in PHP array

By Vinay Kumar on 18 Nov 22 | Filed under: PHP
The below program is to find the product of elements in an array. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time.array_product() function in PHPExample<!DOCTYPE html><html><body><?php &nb

How to convert a string into Array elements in PHP

By Deepak Sahoo on 17 Nov 22 | Filed under: PHP
The below program is to split a string as array elements based on delimiter using PHP explode() function. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time. The PHP explode() function is used to break a string i

How to join the array elements into a String

By Deepak Sahoo on 17 Nov 22 | Filed under: PHP
The below program is to combine the array elements into a string with given delimiter using PHP join() function. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time. The PHP join() function is used to get a string

How to merge two arrays in a new array

By Deepak Sahoo on 17 Nov 22 | Filed under: PHP
The below program is to merge two arrays into a new array using PHP array_merge() function. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time. The PHP array_merge() function is used to merge one or more arrays i

Remove The Duplicate Values From An Array in PHP

By Deepak Sahoo on 16 Nov 22 | Filed under: PHP
The below program is to remove the duplicate values from an array using PHP array_unique() function. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time. The PHP array_unique() function is used to remove the dupli

PHP Program for checking Palindrome number

By Vishal Gupta on 16 Nov 22 | Filed under: PHP
The below program checks for a Palindrome number using a loop. The PHP echo statement is used to output the result on the screen. A number is called as a Palindrome number if the number remains same even when its digits are reversed.Palindrome Number:abcde = edcbaExample: 24142, 1234321, etc.Example