I need an extension in Visual Studio Code, to make my PHP code clean. I am a total beginner. What do you suggest?


You can install Extension php cs fixer by User "junstyle".

It will turn this:


$a = array("a" => 

"b"           =>  "foo")

into this (on save, if you so wish):

$a = ['a'         => '#test',
    'b'           => 'foo'] 

How php-cs-fixer transforms things can be a bit tricky to configure. I have created a config file .vscode/php-cs-fixer.config.php in my VSCode workspace. But I don't remember many details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.