1
<?
$Tweet = file_get_contents("http://api.twitter.com/1/statuses/user_timeline.json?screen_name=EdVizenor&count=1");

//$Tweet = explode(",",$Tweet);
/// If I explode and echo the $Tweet(3); i get .... "text":"mY LATEST TWEET"

var_dump(json_decode($Tweet,true));
?>

What I want to do is parse out the array via key. Something like:

echo $Tweet(text);  /// but this does not work. 

1 Answer 1

1

It would be helpful to know what the error is. The problem is that $Tweet(text) would be calling a function contained in $Tweet, since that variable is not a function, but an actual array, you actually just have to

<?php
// your code
$tweets = json_decode($Tweet,true);
echo $tweets[0]['text'];

Next time, be sure to include the error being thrown, it is very helpful for you to read and understand those!

Sign up to request clarification or add additional context in comments.

3 Comments

What do you mean by "active"?
So I can click on them. right now it's just text. But it would be great if it would see them as links and people can click the links I post on twitter.
Thanks. I think this link might be what I was asking about... tho I have not tested it. tech.cibul.net/turn-urls-into-links-in-text-with-jquery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.