I've learned PHP, I've done a website like online shopping.
Recently, looking at the protocol, touching the socket TCP/IP protocol and things like that.
If I'm not mistaken, the socket is like an API function package that allows TCP and UDP protocols to be implemented with this package
So my question is: when we use PHP to make a Web site, such as when it comes to server and client interaction information, what protocol is implemented? Is it a top-level protocol like the HTTP protocol? Is there no direct relationship between this and the TCP protocol??
Thank you ~
Reply to discussion (solution)
Yes, there is no direct relationship to the TCP protocol
TCP/IP is the underlying communication protocol
The socket is a TCP/IP wrapper
HTTP build and socket
The browser is based on the HTTP protocol, and TCP/IP is also related.
Specifically, you can see the differences between HTTP protocols and TCP/IP.
is essentially a TCP/IP transport protocol. Based on this, a certain format is specified for the transmitted data, for example, which part is the head, which part is data and so on, which forms the HTTP protocol.
This is like using a socket to transfer a JSON-formatted string, then how to extract valid data from the string after receiving it, one reason.
That's how I understand it.