How do you grab and analyze the page?
[code]
.lt;?
$url =.Quot; http://www.domain.com.quot;
?.gt; [/code]
we grab the specified file and present it in an array through the function () function.
[code].lt;?
$url =.Quot; http://www.domain.com.quot;
$lines_array = file ($url); good, now there is already a file in the array. However, the text we want to analyze may not be all in one line. To solve this problem, we can simply transform the array $lines_array into a string. We can use the implode (x, y) function to implement it. If you want to use explode (set string variable array) later, set X to.Quot; |.quot; or.Quot;!.quot; or other similar separators may be better. But for our purposes, we'd better set X as a blank. Y is another necessary parameter because it is an array that you want to use implode ().
[code].lt;
$url =.Quot; http://www.domain.com.quot;
$lines_array = file. In this example, we want to get everything between.Lt; head.gt;.Lt; /head.gt. In order to analyze strings, we also need regular expressions.
[code].lt;
$url =.Quot; http://www.domain.com.quot;
$lines_array = file ($url); In the following format, the eregi () function is performed in the following format:
eregi (.Quot;.Lt; head.gt; (. *).Lt; /head.gt;.Quot; $lines_string, $head);
$lines_string is the string we are analyzing, and $head is an array that is stored after analysis.
finally, we can export data. Because only in.Lt; head.gt; and.Lt; /head.gt; there is an instance in which we can safely assume that there is only one element in the array, and that is what we want.
[code].lt;
$url =.Quot; http://www.domain.com.quot;
$lines_array = file ($url);