PHP: Updating Your Status On Twitter With CURL

Today we look at how you can remotely update your status in twitter. To implement, we need the cURL api and Twitter. Address api, which is necessary for us to update status -. Before you begin, make sure you have installed and enabled cURL! Let's begin. / / Set the username and password $ username = 'alex-g'; $ password ='*********'; / / The message that we want to send $ message = 'Hurray!, I updated my remote status:) '/ / Address of Twitter api $ url =''; $ curl_handle = curl_init (); curl_setopt ($ curl_handle, CURLOPT_URL,' $ url '); curl_setopt ($ curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt ($ curl_handle , CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ curl_handle, function curl_init () we initialize the session and then set the option for it using the function curl_setopt (). Then we execute cURL-query using the function curl_exec () and close the session curl_close ().