Already I searched for the propose and I found many answer but not helpful , and I posted Text on twitter easily but , when I tried to post Image I got bool(false) Error , the below code I used for posting image but not working till now , kindly help me , what's the error of my code :
<?php
require 'tmhOAuth.php';
require 'tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => '***************',
'consumer_secret' => '***************',
'user_token' => '***************',
'user_secret' => '***************',
));
$image = 'myImage.jpg';
$code = $tmhOAuth->request('POST', 'https://upload.twitter.com/1/statuses/update_with_media.json',
array(
'media[]' => "@{$image}",
"status" => "Is this working now?"
),
true, // use auth
true // multipart
);
if ($code == 200) {
var_dump(json_decode($tmhOAuth->response['response']));
} else {
var_dump($tmhOAuth->response['response']);
}
?>
My result is :