This is a project to get an actually usable telnet client library for a task I had at work: communicating with heterogeneous hosts through telnet. The project had to be in PHP for work-related reasons. The code is available here.
Interestingly, perhaps the most interesting (although apparently I didn't even document it!) part of this is the asciiseqfilter and the AnsiAsciiControlParser class it depends on. The script can be used to filter out ASCII control sequences that make it notoriously difficult to automate HP ProCurve telnet automation. The AnsiAsciiControlParser class is already integrated into TelnetClient.php, however.