What does Predefined constant mean in PHP for a module like trader

I am using this module PHP trader.

I am not able to understand what "Predefined constant" means. Should we define these before we call the functions? Should we define them as numbers, or is there no need to mention them before calling the functions?

http://php.net/manual/en/trader.constants.php:

Predefined Constants - The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.


No, you don't have to define anything.

The predefined constants are defined by the extension, so that you can use symbolic names rather than "magic" constants. For example, you would write:

$a = trader_ma ($real, $period, TRADER_MA_TYPE_DEMA);

which carries more meaning to the reader than

$a = trader_ma ($real, $period, 42); /* to pick a random number */

that just contains some mysterious number that you have to look up in a manual every time you read it.

链接地址: http://www.djcxy.com/p/58930.html

上一篇: 无法使用htaccess,1and1设置根目录标头

下一篇: 预定义的常量在PHP中对于像交易者这样的模块意味着什么