File tree Expand file tree Collapse file tree 1 file changed +28
-5
lines changed Expand file tree Collapse file tree 1 file changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,22 @@ This is a community fork of the original
37
37
[ netscape-bookmark-parser] ( https://github.com/kafene/netscape-bookmark-parser )
38
38
project by [ Kafene] ( http://kafene.org/ ) .
39
39
40
+ ## Installation
41
+
42
+ Using [ Composer] ( https://getcomposer.org/ ) ([ package] ( https://packagist.org/packages/shaarli/netscape-bookmark-parser ) ):
43
+
44
+ ``` bash
45
+ composer require shaarli/netscape-bookmark-parser
46
+ ```
47
+
40
48
## Example
41
49
Script:
42
50
``` php
43
51
<?php
44
- require_once 'NetscapeBookmarkParser.php';
52
+
53
+ require_once 'vendor/autoload.php';
54
+
55
+ use Shaarli\NetscapeBookmarkParser\NetscapeBookmarkParser;
45
56
46
57
$parser = new NetscapeBookmarkParser();
47
58
$bookmarks = $parser->parseFile('./tests/input/netscape_basic.htm');
@@ -53,29 +64,41 @@ Output:
53
64
array(2) {
54
65
[0] =>
55
66
array(6) {
56
- 'tags' =>
57
- string(14) "private secret"
58
67
'uri' =>
59
68
string(19) "https://private.tld"
60
69
'title' =>
61
70
string(12) "Secret stuff"
62
71
'note' =>
63
72
string(52) "Super-secret stuff you're not supposed to know about"
73
+ 'tags' =>
74
+ array(2) {
75
+ [0] =>
76
+ string(7) "private"
77
+ [1] =>
78
+ string(6) "secret"
79
+ }
64
80
'time' =>
65
81
int(971175336)
66
82
'pub' =>
67
83
int(0)
68
84
}
69
85
[1] =>
70
86
array(6) {
71
- 'tags' =>
72
- string(18) "public hello world"
73
87
'uri' =>
74
88
string(17) "http://public.tld"
75
89
'title' =>
76
90
string(12) "Public stuff"
77
91
'note' =>
78
92
string(0) ""
93
+ 'tags' =>
94
+ array(3) {
95
+ [0] =>
96
+ string(6) "public"
97
+ [1] =>
98
+ string(5) "hello"
99
+ [2] =>
100
+ string(5) "world"
101
+ }
79
102
'time' =>
80
103
int(1456433748)
81
104
'pub' =>
You can’t perform that action at this time.
0 commit comments