Filtre &

1 Cevap

Nasıl bu dizi açabilirsiniz:

print_r ($ dizi)

Array (
    [131] => stdClass Object
        (
            [tid] => 131
            [vid] => 9
            [name] => apple
            [description] => 
            [weight] => 0
        )

    [112] => stdClass Object
        (
            [tid] => 112
            [vid] => 9
            [name] => cool
            [description] => 
            [weight] => 0
        )

    [113] => stdClass Object
        (
            [tid] => 113
            [vid] => 9
            [name] => wonderful
            [description] => 
            [weight] => 0
        )

)

Bu içine:

apple cool wonderful

Basically take out the "name" variable of the array and implode it in order. I tried implode, but I don't know how to only reference to the "name" variables.

1 Cevap

echo join(" ", array_map(create_function('$x', 'return $x->name;'), $arr));

Bunu yapmanın bir yolu var mı