Find out Maximum and Minimum number from an array. Create an Unique Array and count no of each repeat elements in an array
Find out Maximum and Minimum number from an array. Create an Unique Array and count no of each repeat elements in an array. STEP 1: First we need to declare an array of our own size with duplicate values as the array size is not mentioned to create an unique array and to count the number of repeat elements in an array. $arr=[22,4,10,13,13,13,27,92,12,20,20]; STEP 2: Then to find the maximum and minimum numbers from an array we need to declare two variables as per our choice where we need to assign the array with max() function and min() function in that two variables like here I have assign the max() function of $arr in $max variable and also I have assign the min() function of $arr in $min variable where $ symbol is the super global variable and then I have print the output of maximum and minimum number using print_r(). NOTE: Super global variable is the pre-defined variable which is accessible from any function, class or file. $max=max($arr); $min=min($arr); print_r...