@GuitarMasterx7: yes, you could use this regardless of what IDE you use.
This is a PHP snippet, so you would need to add it to a .php file. You'd also want to wrap the code within the respective <?php ?> tags.