What is the use of the get_resources () function in PHP
This article mainly introduces the use of the get_resources () function in PHP, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Get_resources () var_dump (get_resources ())
/ / array (3) {
/ / [1] = >
/ / resource (1) of type (stream)
/ / [2] = >
/ / resource (2) of type (stream)
/ / [3] = >
/ / resource (3) of type (stream)
/ /}
$fp = fopen ('1.txtrecording and recording r')
Var_dump (get_resources ())
/ / array (4) {
/ / [1] = >
/ / resource (1) of type (stream)
/ / [2] = >
/ / resource (2) of type (stream)
/ / [3] = >
/ / resource (3) of type (stream)
/ / [5] = >
/ / resource (5) of type (stream-context)
/ /}
This function returns the case of the active resource. For example, in the above example, we first print the contents of this function with only three pieces of data, and then we load a file resource with fopen () and get a resource handle. At this point, print the contents of this function again, and you will find that there is one more item, and the type is a resource handle of type stream-context. This function helps us to see if there are any freed resource operations while debugging.
Thank you for reading this article carefully. I hope the article "what is the use of the get_resources () function in PHP" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!