I’m not sure you should be asking people to write code for you, but anyway, here you are.
<?php
$request = file_get_contents( 'http://search.twitter.com/trends/current.json' );
$json = json_decode( $request, true );
$trends = $json[ 'trends' ];
$keys = array_keys( $trends );
$trends = $trends[ $keys[ 0 ] ];
$trends = array(
$trends[ 0 ][ 'name' ],
$trends[ 1 ][ 'name' ],
$trends[ 2 ][ 'name' ]
);
NOTE: Above used Twitter API is no longer active
2
solved How to get the trending topics of twitter with php? [closed]