Hello,
I have a php script that uses sockets and outputs everything to the console. This is a command line application. I am trying to grab some strings from the output and put it into an array. Now The explode function works but it doesn't place the strings in the right place. I am trying to make it so I can update the array later and make sure its all in order.
example output:
You just logged on line 1 from: localhost
Your name is now: NakenBot
COMMAND FOUND! EXECUTING
[1]NakenBot logged in and systems up!
@
+[0]Derrick
+[1]NakenBot
as you can see above, I want to capture the names after the @. the + means that they are online and the name has not changed. When the name has a - in front of it, that means either the name has changed or they have left the chat. It would be easier if the script detected the - to redo the whole array with the +.
I have a explode function but it isn't what I want. I would like to have the array numbers match the number next to the name. I also need to figure out how to search the array with a wild card. It would be really nice if I could have it the following:
array => 0 => Derrick
array => 1 => NakenBot
then I could search for the number or the name and be able to output them both
hope this makes sense