the below code I used for posting image to twitter but nothing happened, really post text its to easy , but posting image no , I searched but there was no correct result :
<?php
include ("OAuth.php");
include ("twitteroauth.php");
include ("tmhOAuth.php");
include ("tmhUtilities.php");
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => 'SDKFJDKSLFJLAKSDFJLKSDJFLKSDJFKLS09RYER;',
'consumer_secret' => 'JSDFLKDJSFLKDSJFLKJSDKLFJDLKFJKLDFJKLSDJF',
'user_token' => '93593-SDLKFJSDLKFJKLSDFJKLSDJFKLSDJFLKSDF',
'user_secret' => 'KSDJFKLSDJFR93490E90RI90WEIR90EIEIF9DIF',
));
$image = 'image.jpg';
$code = $tmhOAuth->request( 'POST','https://upload.twitter.com/1/statuses/update_with_media.json',
array(
'media[]' => "@{$image};type=image/jpg;filename={$image}",
'status' => 'message text written here',
),
true, // use auth
true // multipart
);
if ($code == 200){
tmhUtilities::pr(json_decode($tmhOAuth->response['response']));
}else{
tmhUtilities::pr($tmhOAuth->response['response']);
}
return tmhUtilities;
?>
Kindly inform me if there any error , please guys I need it , thanks for any help