1. foreach ($lines as $line_num => $line) {
  2. echo "Line {$line_num} : " . htmlspecialchars($line) . "
    \n";
  3. }
  4. ?>
复制代码

2,获取网页的标题:

  1. $lines_array = file($url);
  2. echo $lines_array;
  3. echo "
    ";
  4. $lines_string = implode('', $lines_array);
  5. eregi("", $lines_string, $head);
  6. echo "head:".$head;
  7. echo "
    ";
  8. print_r($head);
  9. echo "
    ";
  10. echo "title:".$head[1];
  11. ?>
复制代码


09-07 04:16