Find or list all constants used in a PHP file

前端 未结 2 1932
梦毁少年i
梦毁少年i 2021-01-18 07:13

How to manage constants?

I am using zencart for my site.

I add all global constants in:

includes/languages/english/english.php

相关标签:
2条回答
  • 2021-01-18 07:32

    PHP has a function for every task known to mankind.

    This includes the get_defined_constants() function.

    0 讨论(0)
  • 2021-01-18 07:49

    some ides, like netbeans, phpstorm, and probably many others have features like "find usages" and "refactor" which are really useful when renaming/updating/deleting, and they support constants.

    this doesn't tell you "what comments are used in a specific file", but, i'm guessing its useful to you for similar purposes.

    0 讨论(0)
提交回复
热议问题