Home >Backend Development >PHP Tutorial >What is a PHP handle

What is a PHP handle

小云云
小云云Original
2018-03-09 13:01:413353browse

The handle is the resource that operates an object, that is, operates a certain target, and the handle is the callback function. Handle can also be understood as a handle. Having a handle is equivalent to having a resource. Operating on handles is equivalent to operating resources by following the clues. In fact, the object is not fixed in the memory address. The fixed handle points to the address of the corresponding object in the memory. It can also be said that a handle is a channel, an object that maintains a certain state.

A resource cannot be used directly under a certain property, so a handle is used to operate it.

For example:

1》》You need to verify your identity to operate the database. You can operate the database with the handle of the database and the login information.

2》》The reading and writing of files has the position of the file pointer. Reading and writing need to control the position of the pointer. The handle forms a channel with state at this time.

3》》The timer is a state. The timer is assigned to the handle. When something is triggered, the handle can be processed (cancel the timer, trigger in advance)

4》》 Baidu explains that a handle is a special smart pointer. When an application refers to a memory block or object managed by another system {{database||operating system}}, a handle must be used.

For example: For example, if the target is your female supporter, then the handle is your female supporter’s mobile phone number. You don’t need to pay attention to where your female supporter is at all times, because you can just call and find out. Wherever she is, when she releases the handle, she just makes a phone call and says "Let's break up"!

小 Lizi:

//建立资源 
//根据句柄操作资源
$data = curl_init();
curl_setopt($data,CURLOPT_URL,$url);
curl_setopt($data,CURLOPT_NOBODY,TRUE);
//根据句柄执行这个资源
curl_setope($data,CURLOPT_RETURNTRANSFET,TRUE);
$head = curl_exec($ch);

I saw a great saying on the Internet and shared it with you happily:

The English word "love handle" refers to the stomach. The little fat that can be pinched around can be literally translated as "the handle of love"

Related recommendations:

Detailed explanation of JavaScript implementation of event handler binding listening function example

Recommended articles about window handles

HTML5 tags, event handler attributes and browser compatibility quick guide

The above is the detailed content of What is a PHP handle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn