I have found this little script in PHP that send a simple request to twitter for update your status, I have tried this: http://pratham.name/twitter-php-script-without-curl.h
If you don't put quotes around "$head" then your formatting won't be as you (or Twitter) expect it. Also, since your variable contains newlines/carriage returns, it will probably help to suppress echo from supplying its own.