I am getting this result when trying to access my twitter feed with PHP:
Sat Apr 07 07:29:11 +0000 2012
How can I change it so it’s only “Apr 07“?
Code I am using:
$tweets = getTweets("http://twitter.com/status/user_timeline/justinbieber.json?count=3");
foreach($tweets as $tweet) {
$time = $tweet->created_at;
}
Use
strtotime()to convert it to a timestamp and then format it usingstrftime()ordate().So in your case:
However, calling a variable containing month and day “time” is a really bad idea. It’s a date after all.