Home >Backend Development >PHP Tutorial >How to convert the sqlite database file of favdb exported by 360 browser into html in php
This article mainly introduces the sharing of php code Converting the sqlite database file of favdb exported by 360 browser to html. Friends who need it can refer to it
The following is a piece of php code that explains how to convert the favdb sqlite database file exported by 360 browser into html. The code below is simple and easy to understand. Friends who are interested can take a look.
The php code is as follows:
<?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';
The above is the detailed content of How to convert the sqlite database file of favdb exported by 360 browser into html in php. For more information, please follow other related articles on the PHP Chinese website!