How can I open a basic PHP block in Visual Studio Code, like so - <?php ?>?
In Sublime Text I simply type php and press Tab, and the block is created. But I can't find the same shortcut for Visual Studio Code.
You can add a custom user snippet to Visual Studio Code:
Paste the following custom snippet:
"php": {
"prefix": "php",
"body": [ "<?php $1 ?>" ],
"description": "php tag"
}
Use:
Open Visual Studio Code
Open menu File → Preferences → User Snippets
Search and select "html.json"
Now paste this code in {}:
"php": {
"prefix": ["<?", "<? ", "php"],
"body": [ "<?php $1 ?>" ],
"description": "php tag"
}
Now you can use "<?" or "<? " or "php".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With