php if statement null and 0?
<p>i'm having trouble executing my if statement</p>

<blockquote>
  <p>if($parent == $page->parent)</p>
</blockquote>

<p>my dollar $parent = null and my $page->parent = 0 how do i fix this that they are equal?</p>

<p>i think it's a problem with the fact it doesn't know that null is equal to 0</p>

<pre><code>$page = Page::find($id);
$parent = Input::get('parent'); // Null
</code></pre>

<p>i hope you guys can help me out i have to figure this out</p>

<p>here's my controller just in case you wan't to take a look at it</p>

<pre><code>public function updateMenu($id)
{
    $page = Page::find($id);
    $parent = Input::get('parent');
    $new_order = Input::get('index');

    if($parent == $page-&gt;parent)
    {
        if($page-&gt;order_id &gt; $new_order)
        {
            DB::table('pages')
                -&gt;where('parent',$parent)
                -&gt;where('order_id', '&lt;', $page-&gt;order_id)
                -&gt;increment('order_id');
        }
        else
        {
            DB::table('pages')
                -&gt;where('parent',$parent)
                -&gt;where('order_id', '&gt;=', $page-&gt;order_id)
                -&gt;decrement('order_id');
        }
    }
    else
    {

            DB::table('pages')
                -&gt;where('parent',$parent)
                -&gt;where('order_id', '&gt;=', $new_order)
                -&gt;increment('order_id');

    }



    $page-&gt;order_id = Input::get('index');
    $page-&gt;parent = Input::get('parent');

    $page-&gt;save();

    return $id;
}
</code></pre>
