mirror of
https://github.com/helloxz/onenav.git
synced 2026-07-12 21:12:11 +08:00
test
This commit is contained in:
parent
8f0af5a70b
commit
5e8109bc93
24
test.php
Normal file
24
test.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
$content = file_get_contents('./bookmarks_2021_4_8.html');
|
||||
|
||||
$pattern = "/<A.*<\/A>/i";
|
||||
|
||||
preg_match_all($pattern,$content,$arr);
|
||||
|
||||
foreach( $arr[0] as $link )
|
||||
{
|
||||
//var_dump($link);
|
||||
#$pattern = "/href=\"(.*)\"? ADD_DATE/i";
|
||||
$pattern = "/http.*\"? ADD_DATE/i";
|
||||
preg_match($pattern,$link,$urls);
|
||||
$url = str_replace('" ADD_DATE','',$urls[0]);
|
||||
$pattern = "/>.*<\/a>$/i";
|
||||
preg_match($pattern,$link,$titles);
|
||||
|
||||
$title = str_replace('>','',$titles[0]);
|
||||
$title = str_replace('</A','',$title);
|
||||
//echo $url;
|
||||
//exit;
|
||||
echo $title.' - '.$url."<br />";
|
||||
//echo 'dsd';
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user