Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of Magic constant and example Code of php

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "the detailed explanation of magic constant and example code of php". In the daily operation, I believe that many people have doubts about the detailed explanation of magic constant and example code of php. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "detailed explanation of magic constant and example code of php". Next, please follow the editor to study!

Detailed explanation of php Magic constant

Example:

Class MoShu {public function moshu () {echo 'current class name:'. _ _ CLASS__. Echo 'current method name:'. _ _ FUNCTION__. Echo 'the number of lines in the current file:'. _ _ LINE__. Echo 'absolute path to the current file:'. _ _ FILE__. Echo 'the folder of the absolute path where the current file is located:'. _ _ DIR__. ; echo 'returns the class name:: method name:'. _ _ METHOD__. "";} $moshu = new moshu (); $moshu- > moshu ()

The results are as follows:

Current class name: MoShu current method name: moshu current file in the number of lines: 10 current file absolute path: d:\ xampp\ htdocs\ test\ moshu.php current file where the absolute path folder: d:\ xampp\ htdocs\ test returns the class name:: method name: MoShu::moshu so far, on the "php magic constant and example code" learning is over, I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report