Update your Twitter status using PHP

Twitter is an awesome service! I use it on a daily basis and have grown addicted to it. Posting to twitter VIA an application is something that I’m sure you’ll need to do at some point. Using this simple little script below, you can post updates to twitter accounts fairly easily. Don’t forget to add your username, password and message below.

Now call this method to send your tweet!

Follow me on Twitter 😉

18 thoughts on “Update your Twitter status using PHP”

  1. {syntaxhighlighter brush: php}

    $twitterUsername = trim($strPassword);


    should be

    {syntaxhighlighter brush: php}

    $twitterPassword = trim($strPassword);


    and you have this twice in the same if statement

    {syntaxhighlighter brush: php}



  2. Hi !

    I used your function for my website, it is very useful ! But, how I refer to you on my acknowledgments page ? I should display a license or something else, make a link to this page or to your site ?


  3. i really enjoy going through your posts here and i’ve been watching from a distance but felt the need to comment to let you know. keep it up. is there a RSS feed? I just installed bloglines and want to add it in there.

  4. Hey and thanks for this great snippet.

    Yesterday everything worked fine, but since today i cant post to twitter.

    I always get “Could not post your Tweet to Twitter”.

    Does anyone know why?

Leave a Reply

Your email address will not be published. Required fields are marked *