ne anlamına yankı açıklamada virgülle nedir?

0 Cevap php

I am trying to echo a string from a Recursive function:
echo "<li>", $node, recurse($arr), "</li>";
and
echo "<li>" . $node . recurse($arr) . "</li>";

function writeList($tree)
{
    if($tree == null) return;
    echo "<ul>";
    foreach($tree as $node=>$children) {
        echo "<li>", $node, writeList($children) , "</li>";
    }
    echo "</ul>";
}

this question (form2) bulunabilir gibi $tree, bir ağaç gibi yapı

And, I can notice that the output from the two is different.
Can someone tell me the difference in using , and . in general, and particularly, in this example?

EDIT: ne ziyade dizeleri yankılanıyordu daha, ben bir değişkene bu fonksiyon elde dize saklamak istiyorsanız. Ben, özellikle, ilk echo deyimi alınan çıktı ilgileniyorum.

EDIT: I am feeding this array:

array
  3 => 
    array
      4 => 
        array
          7 => null
          8 => 
            array
              9 => null
      5 => null
  6 => null

The outputs I am getting is:
(from first echo statement)

<ul><li>3<ul><li>4<ul><li>7</li><li>8<ul><li>9</li></ul></li></ul></li><li>5</li></ul></li><li>6</li></ul>

(Ikinci echo deyimi)

<ul><ul><ul><li>7</li><ul><li>9</li></ul><li>8</li></ul><li>4</li><li>5</li></ul><li>3</li><li>6</li></ul>

0 Cevap