In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what is the use of the get_include_path () and get_included_files () functions in PHP, I believe most people do not know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.
Get_include_path () and get_included_files ()
One of these two functions returns the configuration information of the current include_path, and the other returns the list of files that have been entered by include or require.
Echo get_include_path (), PHP_EOL; / /.: / usr/local/Cellar/php/7.3.0/share/php/pear
Echo ini_get ('include_path'), PHP_EOL; /.: / usr/local/Cellar/php/7.3.0/share/php/pear
Get_include_path () is very simple, its effect is actually the same as echo ini_get ('include_path'), it is to read the configuration value of include_path in the php.ini file. When PHP is in include or require, if it does not have a given path, it will first look in the current directory, and if it does not find it, it will look in the include_path. If the specified file is still not found, an error will be reported. This is what the include_path directory is for, and of course, we rarely use it in our daily development, so just learn about it here.
Include "dynamically view and load PHP extension .php"
Print_r (get_included_files ())
/ / Array
/ / (
/ / [0] = > / Users/zhangyue/MyDoc/ blog posts / dev-blog/php/202005/source/ some functions related to PHP option parameters (1). Php
/ / [1] = > / Users/zhangyue/MyDoc/ blog articles / dev-blog/php/202005/source/ dynamically view and load the PHP extension. Php
/ /)
Get_included_files () is also a very simple and intuitive function that returns which files we are currently loading. The current runtime file is always in the first line, that is, this function returns at least one of its own file paths. We can try to use this function to print the number of loaded files in the entry files or controllers of Laravel or other frameworks, which can also help us understand the loading implementation of the framework.
These are all the contents of the article "what are the functions get_include_path () and get_included_files () in PHP?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.