The highest number in the array is 75
The lowest number in the array is 2
2

Code:

<html>
<head>
<title>PHP TEST YAHHH</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>

<div class="topbar">
<?php
include 'navbar.php';
?>

</div>

<?php

    
    //ex 7.2
    
    // a
    
    echo '<br>';
    
    $myUnsortedArray = array(6,2,56,23,53,67,21,19,75,22);
    
    $length = count($myUnsortedArray) -1;
    $high = 0;
    $low = 10000;
    
    for ($i = 0; $i <= $length; $i++)
    {
        if ($myUnsortedArray[$i] < $low)
        {
            $low = $myUnsortedArray[$i];
        }
        if ($myUnsortedArray[$i] > $high)
        {
            $high = $myUnsortedArray[$i];
        }
    }
    
    echo 'The highest number in the array is ';
    echo $high;
    echo '<br>';
    echo 'The lowest number in the array is ';
    echo $low;
    echo '<br>';
    
    // b
    
    
    $givenNumber = 7;
    
    function findNumber($a)
    {
        $myIntegers = array(5,6,7,12,23,26,45,57,64);
        $lengthTwo = count($myIntegers) -1;
        
        for ($i = 0; $i <= $lengthTwo; $i++)
        {
            if ($myIntegers[$i] == $a)
            {
                echo $i;
            }
        }
    }
    
    findNumber($givenNumber);
    
    
    /* outputs in this format:
    
        



    */
    
?>

<div class="codebox">
<h3>Code:</h3>
<?php
highlight_file("ex021.php");
?>
</div>

</body>
</html>