《PHP實(shí)戰(zhàn):分享php代碼將360瀏覽器導(dǎo)出的favdb的sqlite數(shù)據(jù)庫(kù)文件轉(zhuǎn)換為html》要點(diǎn):
本文介紹了PHP實(shí)戰(zhàn):分享php代碼將360瀏覽器導(dǎo)出的favdb的sqlite數(shù)據(jù)庫(kù)文件轉(zhuǎn)換為html,希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
PHP實(shí)戰(zhàn)下面給年夜家分享了一段php代碼,講解將360瀏覽器導(dǎo)出的favdb的sqlite數(shù)據(jù)庫(kù)文件轉(zhuǎn)換為html,下面代碼簡(jiǎn)單易懂,感興趣的朋友看一下吧.
PHP實(shí)戰(zhàn)php代碼如下所示:
PHP實(shí)戰(zhàn)
<?php
$book_mark_name = 'book_mark.html';
$content = file_get_contents('tb_fav.json');
var_dump($content);
$content_list = json_decode($content,'utf-8');
$content_list = $content_list['RECORDS'];
$content_header = "<!DOCTYPE NETSCAPE-Bookmark-file-1>".
"<!-- This is an automatically generated file.It will be read and overwritten.Do Not Edit! -->".
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\">".
"<TITLE>Bookmarks</TITLE>".
"<H1>Bookmarks</H1>".
"<DL><p>";
file_put_contents($book_mark_name,$content_header);
foreach ($content_list as $item) {
$href = $item['url'];
$add_date = $item['create_time'];
$last_visit = $item['last_modify_time'];
$last_modified = $item['last_modify_time']+1;
$title = $item['title'];
$content = "<DT><A HREF=\"$href\" ADD_DATE=\"$add_date\" LAST_VISIT=\"$last_visit\" LAST_MODIFIED=\"$last_modified\" LOVEFAV=\"0\" FAV_POS=\"1\" >$title</A>"."<br/>";
file_put_contents($book_mark_name,$content,FILE_APPEND);
}
$content_tail = "</DL><p>";
file_put_contents($book_mark_name,$content_tail,FILE_APPEND);
echo 'success';
PHP實(shí)戰(zhàn)以上php代碼是小編給年夜家分享的將360瀏覽器導(dǎo)出的favdb的sqlite數(shù)據(jù)庫(kù)文件轉(zhuǎn)換為html的全部?jī)?nèi)容,希望年夜家喜歡.
歡迎參與《PHP實(shí)戰(zhàn):分享php代碼將360瀏覽器導(dǎo)出的favdb的sqlite數(shù)據(jù)庫(kù)文件轉(zhuǎn)換為html》討論,分享您的想法,維易PHP學(xué)院為您提供專業(yè)教程。
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.snjht.com/jiaocheng/8274.html