This article mainly introduces the sharing of PHP code to the 360 browser exported Favdb SQLite database files converted to HTML, the need for friends can refer to the following
Below for everyone to share a piece of PHP code, explaining the 360 browser exported Favdb SQLite database file converted to HTML, the following code is simple to understand, interested friends to see it.
The PHP code looks like this:
<?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 was an automatically generated file. It'll 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 ';