分享php代码将360浏览器导出的favdb的sqlite数据库文件转换为html
下面给大家分享了一段php代码,讲解将360浏览器导出的favdb的sqlite数据库文件转换为html,下面代码简单易懂,感兴趣的朋友看一下吧。
php代码如下所示:
<?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代码是小编给大家分享的将360浏览器导出的favdb的sqlite数据库文件转换为html的全部内容,希望大家喜欢。
相关推荐
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
yifangs 2020-10-13
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
Noneyes 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28
wwwsurfphpseocom 2020-10-28
diskingchuan 2020-10-23
savorTheFlavor 2020-10-23