Hmm,
This has never worked for me either. Here is something you might want to try:
fsockopen
socket_set_timeout
Whenever I try to read a line from the telnet login, it hangs. I'm assuming that this is because it can't recognize EOF (or end of socket). So maybe socket_set_timeout will read until a timeout.
I'm planning to write a telnet app myself. I'll post a message if I have any luck :-)
-sridhar