I want to parse this txt file so that I can get the data onto a php website in a table form. Here is what it looks like
"USERID1"
{
"name" "Bill1"
"unban" 0
"time" 1189691357
"admin" "Bob"
"reason" "Spammer1"
}
"USERID2"
{
"name" "Bill2"
"unban" 0
"time" 1189691357
"admin" "Bob"
"reason" "Spammer2"
}
"USERID3"
{
"name" "Bill3"
"unban" 0
"time" 1189691357
"admin" "Bob"
"reason" "Spammer3"
}
"USERID4"
{
"name" "Bill4"
"unban" 0
"time" 1189691357
"admin" "Bob"
"reason" "Attacked an admin with shovel"
}
I want it to have the a table with all of this data on it,
ex:
USERID | Name | Unban | Time | Admin | Reason
Userid1 | Bill1 | 0 | 1189691357 | Bob | Spammer1
Userid1 | Bill2 | 0 | 1189691357 | Bob | Spammer2
Userid1 | Bill3 | 0 | 1189691357 | Bob | Spammer3
Userid1 | Bill4 | 0 | 1189691357 | Bob | Attacked an admin with shovel
EDIT: I need it to list the things inside the brackets, so If I had something else in there it would list that but if the file was missing it wouldn't list the missing thing like
"USERID4"
{
"name" "Bill4"
"unban" 0
"gbanstatus" "yes"
}
USERID | Name | Unban | Time | Admin | Reason | Gbanstatus
Userid1 | Bill4 | 0 | N/A | N/A | N/A | Yes