I am fairly new to PHP and have mostly played with various pre-built scripts that I have edited for my own use. Now I am trying to take a text file a parse specific content to a database. I can get as far as open the file but cant figure out the best way to parse out certain content and assign to variable to input to a database. For instance, I want to find the line starting with "Uptime Report for:" and parse out what follows "\synweb" and assign to a variable. The rest is pretty much the same but I also want to ignore the section starting with "Date: Time: Event:". The other part is that some of the lines are a bit more complex such as "Current System Uptime: 12 day(s), 20 hour ..." I only want the "12", "20" values etc.
Any help would be greatly appreciated.
<Begin Text>
Uptime Report for: \synweb
OS: Windows NT 4.0 (Build 1381), Service Pack 6, Uniprocessor Free.
Time Zone: Pacific Standard Time
System Events as of 3/13/01 9:55:12 AM:
Date: Time: Event: Comment:
2/17/01 8:58:42 AM Shutdown Prior uptime:0d 21h:49m:48s
2/17/01 9:00:06 AM Boot Prior downtime:0d 0h:1m:24s
2/28/01 1:19:23 PM Shutdown Prior uptime:11d 4h:19m:17s
2/28/01 1:21:47 PM Boot Prior downtime:0d 0h:2m:24s
Current System Uptime: 12 day(s), 20 hour(s), 33 minute(s), 6 second(s)
Since 11/10/00:
System Availability: 99.9614%
Total Uptime: 122d 22h:15m:51s
Total Downtime: 0d 1h:8m:16s
Total Reboots: 37
Mean Time Between Reboots: 3.32 days
Total Bluescreens: 0
<End Text>