DFA (deterministic finite automaton) can be used to implement deterministic finite state machines. DFA takes as parameters arrays that define the alphabet of symbols accepted as input and lists of all possible states and transitions. It takes a string a input symbols to process and determines if the final state is valid. Requirements: PHP 5.0 or higher