Forums

What does this ampersand here do: =& (4 posts)

  1. banago
    Member
    Posted 8 months ago #

    Hi guys,

    I've got his code that I use a lot.

    $images =&get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . get_the_id() );

    My question is what does the ampersand (bolded) do in that case?

  2. nsathees
    Member
    Posted 8 months ago #

  3. banago
    Member
    Posted 8 months ago #

    No, that won't answer my question, but thanks anyway. I read that before I came to the forums for help.

  4. Peter Baylies
    Member
    Posted 8 months ago #

    This is the assign by reference operator; this way you get a real reference (or alias) as opposed to a copy of a reference; this doesn't matter so much these days, assuming you're using PHP5.

    http://www.daaq.net/old/php/index.php?page=php+variables&parent=php+basics

    http://stackoverflow.com/questions/2252303/why-is-the-php-assignment-operator-acting-as-an-assignment-by-reference-in-this-c

Reply

You must log in to post.

About this Topic

Tags