We are switching from array()
to []
in our php code. And when I start to do code refactoring I found that almost all arrays are specified with array()
and not with []
. How can I substitute it by vim
?
Example:
// アクセスログを取る
$this->set('log_access', array(
'target' => 'topic',
'id' => $id
));
I want to change to:
// アクセスログを取る
$this->set('log_access', [
'target' => 'topic',
'id' => $id
]);
And
$opts = array('http' => array('header' => 'User-Agent: iPhone-preview'));
I want to change to:
$opts = ['http' => ['header' => 'User-Agent: iPhone-preview']];