Is the handle specific to the concept of a windows operating system? why do we need to raise this question? it seems that this logic is often used in PHP, so I want to understand it. Baidu once seems that the handle is a product in windows, so does another system, such as Linux and UINX, also have this stuff? There is also the concept of hooks. it seems that the handle is also a hook, so what is the hook? PHP is messy.
Also, $ _ mysqli = new mysqli ('cocalhost', 'root', 'angfan ', 'cms'); in this sentence, why do we say $ _ mysqli is the handle?
I understand it as a variable.
Reply to discussion (solution)
Handle
N. [built] handle; feel; solid mouth
Vt. processing; Operation; use; sales; touch
Vi. handling; easy to manipulate
Handle for habitual translation
Actually, it is the index of system resources.
It is obviously better to pass only the index number of a resource entity in a program.
In php
$ _ Mysqli = new mysqli ('cocalhost', 'root', 'angfan ', 'cms ');
$ _ Mysqli is an object. of course, the object's reference is also a handle.
$ _ Mysql = mysql_connect ('cocalhost', 'root', 'angfan ');
$ _ Mysql is a resource, that is, a handle
Handle
N. [built] handle; feel; solid mouth
Vt. processing; Operation; use; sales; touch
Vi. handling; easy to manipulate
Handle for habitual translation
Actually, it is the index of system resources.
It is obviously better to pass only the index number of a resource entity in a program.
In php
$ _ Mysqli = new mysqli ('cocalhost', 'root', 'angfan ', 'cms ');
$ _ Mysqli is an object. of course, the object's reference is also a handle.
$ _ Mysql = mysql_connect ('cocalhost', 'root', 'angfan ');
$ _ Mysql is a resource, that is, a handle
What is the difference between variables and resources?
Let's just say:
Resources actually exist, such as you.
A variable is a carrier or a name. For example, your ID card will never be shopnc_02, but he represents you.
A handle is a memory block or object managed by a system (such as a database or an operating system). It is not a window concept.
In the window, the reference of the form is the handle. this is because it is officially called, and then the function such as HWND hWnd = AfxGetMainWnd ()-> m_hWnd; you can see that this type of name is the handle.
In fact, the opened files open directories open database connections can be called handles, but not everyone is called this. they are all called "database connections" "file descriptors"
In PHP, you can assign a resource as a handle.