Share the PHP code to convert the FAVDB SQLite database file from the 360 browser to the html_php instance

Source: Internet
Author: User
Tags sqlite sqlite database

Here to share a section of PHP code, to explain the 360 browser exported FAVDB SQLite database files to HTML, the following code easy 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 is a 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 ';

The above PHP code is a small set for everyone to share the 360 browser exported FAVDB SQLite database files to the full content of HTML, I hope you like.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.