Help creating a php parser

Czar

Lifer
Oct 9, 1999
28,510
0
0
Its been a loooong time since I did anything in php and now I want to do a parser for a text like this one that would put the appropriate varibles into an array or a few arrays. Then put it all into a db which isnt that much of a problem, but the parser is.

2004.08.10 22:25:00

Victim: Calisto Lockhart
Corporation: LEGI0N
Destroyed Type: Bellicose
Solar System: Manarq
System Security Level: 0.8

Involved parties:

Name: Arud (laid the final blow)
Security Status: 1.2
Corporation: MASS
Ship Type: Malediction
Weapon Type: Medium Afocal Pulse Maser I

How would I go about doing this?
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
How big might the file be? I.e. can the script afford to be somewhat inefficient? (more runtime efficiency == more work to code it)

edit: wait, might there be more than one involved party per victim? don't be stingy with details!
 

Czar

Lifer
Oct 9, 1999
28,510
0
0
yes there can be more than one party per victim, they changed the "kill mails" yesterday so I dont have any new multikill mails but here is how the old ones look like

2004.08.09 14:00:00

Destroyed Type: Raven
Solar System: Misaba
System Security Level: 0.1

Involved parties:

Name: Sinjin Smythe
Security Status: 3.3
Corporation: MASS
Ship Type: Tempest
Weapon Type: Unknown

Name: Ackath
Security Status: 2.5
Corporation: MASS
Ship Type: Scorpion
Weapon Type: Unknown

Name: Nick Curso (laid the final blow)
Security Status: -0.2
Corporation: MASS
Ship Type: Scorpion
Weapon Type: Bane Torpedo I

They mostly changed the first part of the mail, now it contains the name and corp name. The one who got (laid the final blow) behind their name needs some special flag since thats the one who got the kill mail, the others just helped.

This will just be a text box on a webpage where people paste in the information.

edt. And where in the list the final blow guy is is pretty random, he could be named first, second, third and so on
 

Czar

Lifer
Oct 9, 1999
28,510
0
0
I have thought about creating an ugly parser

each line gets split into two varibles in an array, : being the split character, except the first line, first line gets parsed normaly

then a case, if, which or whatever argument goes into the array,
something like
if arrayA[1,0] == Destroyed Type then arrayB[1,0] = arrayA[1,1]

or something like that.... i'm very rusty as can be seen
 

Czar

Lifer
Oct 9, 1999
28,510
0
0
nahh, I never realy got started but someone else did so its not a problem anymore
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |