Forum Moderators: coopster

Message Too Old, No Replies

parsing command strings with php

         

partha

11:39 pm on May 26, 2005 (gmt 0)

10+ Year Member



I thought I saw how to do this somewhere before, but now I can't seem to find anything on google:

I'm just looking for a php function that will parse a command string for me -- I pass it a string like "walk dog and make me coffee" and have it be able to determine that I want to pass dog to walk() and coffee,me to make().

StupidScript

11:59 pm on May 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's definitely not a stock function, there. Possibly it would work by parsing the string and comparing the elements to a verb array and a target array, and then marrying them.

I haven't seen a command string like that since the TRS-80, but it looks intriguing.