-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathREADME
30 lines (22 loc) · 946 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Simply include the file adif_parser.php and create a new ADIF_Parser.
include 'adif_parser.php';
$p = new ADIF_Parser;
Now you need to give it some data. You can use the class member feed($string) to give it a string of text like this
$p->feed("ADIF File as String");
Or you can give it a filename with load_from_file($fname)
$p->load_from_file($fname);
Then it must be initialized with the initialize function and each record can be extracted using get_record(). get_record() returns an array with the field as the key. You can view the possible fields here. If the array is empty that means that there are no more records to process. Here is some example code to extract the callsigns from a text file called test.adi.
<?php
include 'adif_parser.php';
$p = new ADIF_Parser;
$p->load_from_file("test.adi");
$p->initialize();
while($record = $p->get_record())
{
if(count($record) == 0)
{
break;
};
echo $record["call"]."<br>";
};
?>