Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.
Most people seem to run into trouble when their commands (or command arguments) have special charaters and need quotes..
Here is my simple cmd function that takes care of this:
telnet is an interactive problem, so you would need something like expect.. Or pipe the commands...
Or open a socket and fwrite/fread with native php functions...