79769817

Date: 2025-09-19 17:59:39
Score: 1.5
Natty:
Report link

This is a quote from another answer on superuser.com: (https://superuser.com/questions/612178/how-to-set-php-syntax-for-a-file-without-php-tag?utm_source=chatgpt.com)

Put #<?php at the top of the file. PHP will treat it as a comment. Sublime won't. Perfect.

if helpful for anybody I also want to point out that this trick works for vscode. I am using this bc I have some software where i have to input pure php without open tag and i also save the whole code in a php file which requires the open php tag. With this comment trick i can still get syntax highlighting and also copy the whole file in the software where it will treat the first line as a comment.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: CodeCubeNeo