NetBeans does not complete this code by default, so you have to manually add the code template.
In NetBeans click:
Tools > Options > Editor > Code Templates
Choose the HTML language as it is being used until you put the PHP tag.
Click New , type the shortcut you want autocomplete, for example php
, click OK .
On the next screen enter the code you want to autocomplete when writing php
.
Example:
<?php ?>
In Expand Template in: select the key you want to autocomplete, for example: Tab .
Click OK .
When testing, put the shortcut that in my case was php
and then press Tab .
"And see the Magic!"
For more information: link