# PHP Preferred - Parse firefox bookmarks into html unordered lists?

**URL:** <https://forum.kirupa.com/t/php-preferred-parse-firefox-bookmarks-into-html-unordered-lists/182616>\
**Category:** programming\
**Created:** [March 20, 2006, 2:08am UTC](https://forum.kirupa.com/t/php-preferred-parse-firefox-bookmarks-into-html-unordered-lists/182616 "2006-03-20T02:08:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JRPereira](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JRPereira](https://forum.kirupa.com/u/JRPereira)\
**Post date:** [March 20, 2006, 2:08am UTC](https://forum.kirupa.com/t/php-preferred-parse-firefox-bookmarks-into-html-unordered-lists/182616/1 "2006-03-20T02:08:10Z")

</div>

I’ve been looking around for a while now and I can’t seem to figure out if there’s a way to convert firefox’s bookmarks into html unordered lists. I’m working on it so there’s a public list of interesting links to check out on my site.

I come across a lot of interesting links and do a lot of shifting of things in the bookmarks manager so manually updating the links is a ton of work and insanely tiresome.

I’ve tried parsing it out myself, but I keep getting stuck trying to parse out the urls using regular expressions.

---

<div class="post-metadata">

**Author:** ![JRPereira](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JRPereira](https://forum.kirupa.com/u/JRPereira)\
**Post date:** [March 20, 2006, 3:50am UTC](https://forum.kirupa.com/t/php-preferred-parse-firefox-bookmarks-into-html-unordered-lists/182616/2 "2006-03-20T03:50:16Z")

</div>

Well, I’ve got the first part figured out at least.

/HREF="([^"]_)"._\>(.\*)\</A\>/

To parse out the url and text of the link.

---

<div class="post-metadata">

**Author:** ![abreev8](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@abreev8](https://forum.kirupa.com/u/abreev8)\
**Post date:** [March 21, 2006, 1:49am UTC](https://forum.kirupa.com/t/php-preferred-parse-firefox-bookmarks-into-html-unordered-lists/182616/3 "2006-03-21T01:49:10Z")

</div>

firefox bookmarks are already stored as html lists. Just look in your FF folder. Unless they’ve changed things :puzzle:

---

<div class="post-metadata">

**Author:** ![JRPereira](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JRPereira](https://forum.kirupa.com/u/JRPereira)\
**Post date:** [March 21, 2006, 10:32pm UTC](https://forum.kirupa.com/t/php-preferred-parse-firefox-bookmarks-into-html-unordered-lists/182616/4 "2006-03-21T22:32:03Z")

</div>

> [@abreev8](#):
>
> firefox bookmarks are already stored as html lists. Just look in your FF folder. Unless they’ve changed things :puzzle:

Nah, they’re in this terrible old format with all sorts of extra useless information. If I can successfully parse out the bits that I need, I could probably cut the amount of code by 80%.

I’m pretty close so far - basically done enough to where I should get back to sorting my bookmarks in firefox and see if the output is good enough to just cut/paste and make a few changes.

---

<div class="post-metadata">

**Author:** ![JRPereira](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JRPereira](https://forum.kirupa.com/u/JRPereira)\
**Post date:** [March 23, 2006, 7:27am UTC](https://forum.kirupa.com/t/php-preferred-parse-firefox-bookmarks-into-html-unordered-lists/182616/5 "2006-03-23T07:27:32Z")

</div>

Well, looks like mozilla made my job easier. They switched to xml!
