I've been developing a PHP ajax chat. I now want to add commands like /ban and so on.
But I am not sure how would I do that.
In the first place, I want the commands to start with a '/' sign.
Do I have to first check if the sent message is starting with a '/' sign, correct? And then see if the command 'ban' exists, but how will it know, where in the sentence, the username will be displayed in?
I am really confused, as I have no idea where and how to start. Is there a open source of commands system similar to my needs?
/ban user, this is pretty straightforward to then parse the input strings.