How can I reformat php's old "array()" to the newer/neater "[]" with Visual Studio Code?

Viewed 976

Is there a neat search and replace model for reformatting php's old array style to the newer/cleaner json style - without reformatting the entire document with a formatter extension*

from

$flibble = array('foo' => 'bar');

$wibble = array(
    'linefeeds' => true,
);

to

$flibble = ['foo' => 'bar'];


$wibble = [
    'linefeeds' => true,
];

* Aside; I can't actually find a PHP Formatter for VSC which does this either...

2 Answers
Related