I have a php document that deletes tweets. I want to get “http_code” from it, but nothing is working. Here’s my code:
<?php
require_once('/twitter_files/twitteroauth/twitteroauth.php');
require_once('/twitter_files/config.php');
$oauth_token = "****";
$oauth_token_secret = "****";
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token, $oauth_token_secret);
$content = $connection->delete('statuses/destroy/49628236694556672');
print_r($connection);
?>
With that print_r, I get a really long array that for some reason I can’t read. Here’s a snippet:
TwitterOAuth Object ( [http_code] => 404
How can I read it? I have tried json_decode, but I get errors.
Thanks in advance!
From that
print_routput, we know that it is an instance ofTwitterOAuthobject. And the fact that it’s object means that you can use it this way: