Toggle numbers not included inside the associative array in PHP
<p>Is there a way we can toggle to find out numbers that are not included inside the associative array set?</p>

<p>so if the data is </p>

<pre><code>[options] =&gt; Array
                (
                    [1] =&gt; locality
                    [2] =&gt; postcode
                    [3] =&gt; dwelling_type
                    [4] =&gt; typical_value
                    [5] =&gt; dsr
                    [6] =&gt; dsr_summary
                    [13] =&gt; yield
                    [15] =&gt; search_dsr
                    [16] =&gt; sr
                    [17] =&gt; month
                    [18] =&gt; year
                )
</code></pre>

<p>How do I get an output of 7,8,9,10,11,12,14 programmically if the total count was 18?</p>

<p>SOLVED:</p>

<p>Actually my final answer is</p>

<pre><code>$existingKeys = array_keys($options['User']['options']);
$Keys = range(0,18);
$missingKeys = array_diff($Keys,$existingKeys);
</code></pre>
