Answer the question
In order to leave comments, you need to log in
How to parse socket?
There is a code like
<?php
$address = 'сайт к примеру какой то';
$port = 80;
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, $address, $port);
socket_write($socket, "POST / HTTP/1.0\r\n\r\n");
$result = "";
while($read = socket_read($socket, 1024))
{
$result .= $read;
}
socket_close($socket);
echo "Полученный результат: $result\r\n";
?>
Answer the question
In order to leave comments, you need to log in
use the tool that suits your data.
html - DOM
json - json_decode
xml - SimpleXML
etc
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question