I am writing a script to interface with an SMS gateway.
The message comes in, and i use explode to see if theres a specific access code as the second word.
E.g. People text their message to a shortcode number in the format of "KEYWORD message goes here".
But admin's can text this same number, with a special code to do certian administrative functions. So if an admin text this message: KEYWORD update Welcome it would update a table with the word "Welcome"
I'm using explode() to split the message and check for the administrative word, once it's found, it checks the users mobile number against a DB, and if they're an admin, it will do the next step..
The next step is inserting the information. What I need to do is to remove the "KEYWORD" and "update" from the message, and insert the rest of the message into the database.
The problem is, there are a few different administrative words, so I dont think i could use a simple str_replace().
What would be the best way?
Thanks,
Dave