S
S
serikd2016-03-26 00:12:10
Yii
serikd, 2016-03-26 00:12:10

What does this [$var] operator do?

This code generates Gii

public function forCategory($id)
    {
        $ids = [$id];
        $childrenIds = [$id];
        ...
    }

I don't fully understand what's going on here :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-03-26
@serikd

Creates an array with one element $var.

M
Muhammad, 2016-03-26
@muhammad_97

The "new" way to define an array as of PHP 5.4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question