putting the array data into separate variables
<p>I am trying to put the array data into two separate variables. But not getting it. Here is my code</p>

<pre><code>if($option_query-&gt;row['type'] == 'date') {
    $array1[0] = $option_value;

    foreach ($array1 as $key =&gt; $value) {
        echo "$key = $value&lt;br&gt;";
    }
</code></pre>

<p>Now i am getting the result : </p>

<pre><code>0 = 2013-05-05
0 = 2013-05-07 
</code></pre>

<p>I want to put 1st date in a variable called <code>datestart</code> and 2nd date in to <code>dateend</code>. 
How can I achieve this? </p>

<p>output for var_dump(array1);</p>

<pre><code>array (size=1)
  0 =&gt; string '2013-05-05' (length=10)
array (size=2)
  0 =&gt; string '2013-05-05' (length=10)
  1 =&gt; string '2013-05-07' (length=10)
</code></pre>

<p>EDITED HERE (ADDING)</p>

<pre><code> if($option_query-&gt;row['type'] == 'date' )

                        {


$arr = array( //Assuming that this should be the map of your array
        array(
            $option_value
        ),
        array(
            $option_value
            //$option_value
        )
    );

   // var_dump($arr);

    echo $arr[1][0];
   echo $arr[1][1];

    }


                    }
</code></pre>

<p>I echoed like this and got the o/p</p>

<pre><code>2013-05-20
2013-05-30
</code></pre>

<p>It works!!!!!</p>
