Fabien Potencier has posted a quick and dirty method for sending a tweet to Twitter directly from a PHP script (provided you have a username and password already).
Twitter is everywhere nowadays. Odds are eventually you will want to tweet from PHP. No need to use one of the numerous PHP Twitter libraries, as tweeting is as simple as using the PHP built-in file_get_contents() function.
His example creates a stream (stream_context_create) and calls file_get_contents to send the HTTP request to the twitter API URL.