Page 1 of 1

Parsing Help

Posted: Sun Mar 18, 2007 7:25 pm
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.

Posted: Sun Mar 18, 2007 11:04 pm
by feyd

Posted: Mon Mar 19, 2007 3:45 pm
by Zarel

Code: Select all

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