Friday 28 November 2014

Array Functions in Php

Structure of the Problem Requirements 

In this programme we will implement some functions of Arrays in Php. In example we are take two Array and initialize them. And then some basic and important functions of String we can applied on them. Sorting , Reverse Sorting maximum and minimum number from array, these function will be applied in that example. Here is the source code of programme which help you in better understanding.

SOURCE CODE


<html>
<title> PHP Arrays Demo </title>
<body>
<?php 
echo "<br />";
$my_array_1 = array(21, 23, 15, 57, 29 );
echo "<br />";
?>
<?php
echo "Array 1 : ";
print_r($my_array_1);
echo "<br />";
echo "Total Length : ";
echo count($my_array_1);
echo "<br />";
echo "Maximum Digit : ";
echo max($my_array_1);
echo "<br />";
echo "Minimum Digit : ";
echo min($my_array_1);
echo "<br />";
echo "After Sort : ";
echo sort($my_array_1);
print_r($my_array_1);
echo "<br />";
echo "Reverse Sort : ";
echo rsort($my_array_1);
print_r($my_array_1);
?>
</body>
</html>

OUTPUT OF THE PROGRAM

Arrays in Php
Arrays Function

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment