Q:

Create a program with php that will find the missing number in the series of numbers

i need help with a question, I need to write code in php that will 

find the missing number in the sequence, regardless of that numbers position in the sequence. 
the numbers will increase but the same amount each time. 
the output must be only the number that was missing from the initial list, not just the list with the number in it (I have worked that out myself). 

example number sequence, $sequence = 3, 5, 9, 11, 13
obviously the number 7 is missing, but I don't know how to do the code, im assuming it would use loops, but i wouldn't even know were to start, It must be in PHP 

A:

A more simple way to get the missing number(s) from the sequence, the way I see it:
<?php
    $sequence = array(3, 5, 9, 11, 13);
    $numbers = array(7, 9, 15);
    $single_nr = 7;
    function getMissingNumber(array $sequence, $single_nr = null, $numbers = array())
    {
        // Check if it exists in the sequence array
        // check single number
        if($single_nr)
        {
            if(!in_array($single_nr, $sequence))
            {
                echo $single_nr . " is not in array" . "<br />";
            }
        }

        // check an array of numbers
        if($numbers)
        {
            foreach($numbers as $nr)
            {
                if(!in_array($nr, $sequence))
                {
                    echo $nr . " is not in array" . "<br />";
                }
            }
        }
    }

    echo getMissingNumber($sequence, null, $numbers);
?>

