Parsing Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
darkneonetwork
Forum Newbie
Posts: 1
Joined: Sun Mar 18, 2007 7:06 pm

Parsing Help

Post by darkneonetwork »

I am making a PHP IRC bot and I need help parsing some lines from a whois. The whole thing I need to parse is...

Code: Select all

[00:22:17] <- :talon.nl.eu.SwiftIRC.net 311 [PHP]Darkneobot Dark-And-Dead-Hero ~wildfire 35720160.18EC537F.B82AB597.IP * :Lee Merriman
[00:22:17] <- :talon.nl.eu.SwiftIRC.net 319 [PHP]Darkneobot Dark-And-Dead-Hero :@#darkneo
[00:22:17] <- :talon.nl.eu.SwiftIRC.net 312 [PHP]Darkneobot Dark-And-Dead-Hero hyperion.fl.us.SwiftIRC.net :Hyperion
[00:22:17] <- :talon.nl.eu.SwiftIRC.net 307 [PHP]Darkneobot Dark-And-Dead-Hero :has identified for this nick
[00:22:17] <- :talon.nl.eu.SwiftIRC.net 318 [PHP]Darkneobot Dark-And-Dead-Hero :End of /WHOIS list.

In the second line it says

Code: Select all

[00:22:17] <- :talon.nl.eu.SwiftIRC.net 319 [PHP]Darkneobot Dark-And-Dead-Hero :@#darkneo
I want to check if the channel the bot is in which is in a variable called $chan, if there is an @ before it. How would I do this?
So let's say the chan is #darkneo, I want to parse the script to check if there is a @ before #darkneo.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
Zarel
Forum Newbie
Posts: 2
Joined: Mon Mar 19, 2007 3:23 pm

Post by Zarel »

Code: Select all

substr($line2,strpos($line2,$chan)-1,1)=='@'
Post Reply