|
 |
|
ผมอยากใช้ jquery เก็บ tag a attribute href ทั้งหมดที่มีในเว็บไซต์อย่างไรครับ |
|
 |
|
|
 |
 |
|
ลอกฝรั่งมาอีกที น่าจะไช่ตัวนี้เหละ
<?php
// get links
$website = file_get_contents("https://www.thaicreate.com"); // download contents of www.example.com
preg_match_all("<a href=\x22(.+?)\x22>", $website, $matches); // save all links \x22 = "
// delete redundant parts
$matches = str_replace("a href=", "", $matches); // remove a href=
$matches = str_replace("\"", "", $matches); // remove "
// output all matches
print_r($matches[1]);
?>
|
 |
 |
 |
 |
Date :
2014-06-21 13:36:06 |
By :
meannerss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|