Home>

The following share a piece of PHP code, explaining the conversion of the sqlite database file exported by favdb from 360 browser to html, the following code is simple and easy to understand,Interested friends take a look.

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 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="&d;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 php code is the entire content of the sqlite database file of favdb exported by 360 browser that we share with you.Hope you like it.

php
  • Previous ThinkPHP's solution to pagination failure when using post query
  • Next Installation and configuration tutorial of MySQL performance monitoring software Nagios