Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
DSA
22.8K+ articles
JavaScript
12.2K+ articles
HTML
5.8K+ articles
CSS
4.9K+ articles
JQuery
4.9K+ articles
PHP
3.9K+ articles
ReactJS
3.5K+ articles
Node.js
3.5K+ articles
jQuery-jQWidgets
2.5K+ articles
PHP-function
2.3K+ articles
Web Technologies
/
PHP
/
PHP Programs
PHP Programs
344+ posts
Recent Articles
Popular Articles
PHP floor() Function
Last Updated: 29 June 2022
We sometimes need to round down the float values to the next lowest integer in our maths problems.PHP provides a built-in function floor() to get this task done through ou...
read more
Web Technologies
PHP
PHP Programs
PHP Program to Rearrange Array Such That arr[i] >= arr[j] if i is Even and arr[i]<=arr[j] if i is Odd and j < i
Last Updated: 22 July 2024
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater than all elements before it and elemen...
read more
Web Technologies
PHP
PHP Programs
DSA
Arrays
Sorting Quiz
array-rearrange
PHP Program to Count Primes in Ranges
Last Updated: 22 July 2024
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 = L = R 10000. Consider that there are a large number of que...
read more
Mathematical
Web Technologies
PHP
PHP Programs
DSA
array-range-queries
prefix-sum
sieve
Prime Number
PHP Program to Find the Size of Subarray With Maximum Sum
Last Updated: 22 July 2024
Given an Array, the task is to find the size of the subarray that yields the maximum sum. This article provides a comprehensive guide on how to implement a PHP program to ...
read more
Dynamic Programming
Web Technologies
PHP
PHP Programs
DSA
Arrays
subarray
subarray-sum
PHP Program to Print all triplets in sorted array that form AP
Last Updated: 22 July 2024
Given a sorted array of distinct positive integers, print all triplets that form AP (or Arithmetic Progression)Examples :Input : arr[] = { 2, 6, 9, 12, 17, 22, 31, 32, 35,...
read more
Searching
Hash
Web Technologies
PHP
PHP Programs
DSA
Arrays
cpp-unordered_set
arithmetic progression
PHP Program to Print uncommon elements from two sorted arrays
Last Updated: 22 July 2024
Given two sorted arrays of distinct elements, we need to print those elements from both arrays that are not common. The output should be printed in sorted order.Examples :...
read more
Searching
Web Technologies
PHP
PHP Programs
DSA
Arrays
two-pointer-algorithm
PHP Program for Minimum Product Subset of an Array
Last Updated: 22 July 2024
Given an array Arr, we have to find the minimum product possible with the subset of elements present in the array. The minimum product can be a single element also.Example...
read more
Greedy
Sorting
Technical Scripter
Web Technologies
PHP
PHP Programs
DSA
Arrays
PHP Program to Check Involutory Matrix
Last Updated: 22 July 2024
Given a matrix, the task is to check matrix is involutory matrix or not. Involutory Matrix: A matrix is said to be involutory matrix if the matrix multiply by itself retur...
read more
Mathematical
Matrix
Web Technologies
PHP
PHP Programs
DSA
PHP Program to Interchange elements of first and last rows in matrix
Last Updated: 22 July 2024
Given a 4 x 4 matrix, we have to interchange the elements of first and last row and show the resulting matrix.Examples :Input : 3 4 5 0 2 6 1 2 2 7 1 2 ...
read more
Matrix
School Programming
Web Technologies
PHP
PHP Programs
DSA
PHP Program to Sort the matrix row-wise and column-wise
Last Updated: 22 July 2024
Given a n x n matrix. The problem is to sort the matrix row-wise and column-wise.Examples:Input : mat[][] = { {4, 1, 3}, {9, 6, 8}, {...
read more
Sorting
Matrix
Web Technologies
PHP
PHP Programs
DSA
PHP Program for Identity Matrix
Last Updated: 22 July 2024
Introduction to Identity Matrix : The dictionary definition of an Identity Matrix is a square matrix in which all the elements of the principal or main diagonal are 1's an...
read more
Mathematical
Matrix
School Programming
Web Technologies
PHP
PHP Programs
DSA
PHP Program to Count Sets of 1s and 0s in a Binary Matrix
Last Updated: 22 July 2024
Given a N x M Binary Matrix, count the number of sets where a set can be formed one or more same values in a row or column.Examples:Input: [[ 1, 0, 1 ], [ 0, 1, ...
read more
Combinatorial
Matrix
Web Technologies
PHP
PHP Programs
DSA
PHP Program to Efficiently compute sums of diagonals of a matrix
Last Updated: 22 July 2024
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix.A00 A01 A02 A03A10 A11 A12 ...
read more
Matrix
Web Technologies
PHP
PHP Programs
DSA
school-programming
CBSE - Class 11
PHP Program To Check If A String Is Substring Of Another
Last Updated: 22 July 2024
Given two strings s1 and s2, find if s1 is a substring of s2. If yes, return the index of the first occurrence, else return -1.Examples:Input: s1 = "for", s2 = "geeksforge...
read more
Strings
Pattern Searching
Web Technologies
PHP Programs
DSA
String to Integer in Different Programming Languages
Last Updated: 24 August 2024
Below are example programs to do string to integer conversion in different programming languages.C++#include bits/stdc++.husing namespace std;int main(){ int val; ch...
read more
Strings
Python
C Programs
C++ Programs
Java Programs
C++
Python Programs
PHP Programs
DSA
JavaScript Programs
1
2
3
4
...
23
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !