Issue with script getting Twitter feed

Hi there guys,

there’s my problem: I have this nice php script (i can’t remember right know where I got it, but I’ll be back later to post the link), that gets the live timeline of one or more twitter accounts, and displays it in my WP page.
It works very nice.

<?php
    $usernames = "twitterusername"; // Pull from accounts, separated by a space
    $limit = "5"; // Number of tweets to pull in, total.
    $show = 1; // Show username? 0 = No, 1 = Yes.
    
    $prefix = "<div class='timeline'>"; // This comes before the entire block of tweets.
    $prefix_sub = "<p><span>@"; // This comes before each tweet on the feed.
    $wedge = "</span> "; // This comes after the username but before the tweet content.
    $suffix_sub = "</p>"; // This comes after each tweet on the feed.
    $suffix = "</div>"; // This comes after the entire block of tweets.
    
    function parse_feed($usernames, $limit, $show, $prefix_sub, $wedge, $suffix_sub) {
    
    $usernames = str_replace(" ", "+OR+from%3A", $usernames);
    $feed = "http://search.twitter.com/search.atom?q=from%3A" . $usernames . "&rpp=" . $limit;
    $feed = file_get_contents($feed);
    $feed = str_replace("&", "&", $feed);
    $feed = str_replace("<", "<", $feed);
    $feed = str_replace(">", ">", $feed);
    $clean = explode("<entry>", $feed);
    $amount = count($clean) - 1;
    
    for ($i = 1; $i <= $amount; $i++) {
    
    $entry_close = explode("</entry>", $clean[$i]);
    $clean_content_1 = explode("<content type=\"html\">", $entry_close[0]);
    $clean_content = explode("</content>", $clean_content_1[1]);
    $clean_name_2 = explode("<name>", $entry_close[0]);
    $clean_name_1 = explode("(", $clean_name_2[1]);
    $clean_name = explode(")</name>", $clean_name_1[1]);
    $clean_uri_1 = explode("<uri>", $entry_close[0]);
    $clean_uri = explode("</uri>", $clean_uri_1[1]);
    $clean_content[0] = str_replace("&lt;", "<", $clean_content[0]);
    $clean_content[0] = str_replace("&gt;", ">", $clean_content[0]);
    $clean_content[0] = str_replace("&quot;", "", $clean_content[0]);
    
    echo $prefix_sub;
    if ($show == 1) { echo "<a href=\"" . $clean_uri[0] . "\" target=\"_blank\">" . $clean_name[0] . "</a>" . $wedge; }
    
    echo $clean_content[0];
    echo $suffix_sub;
    
    }
    }
    echo $prefix;
    parse_feed($usernames, $limit, $show, $prefix_sub, $wedge, $suffix_sub);
    echo $suffix;
    ?>

The only thing I had to change in the original, was to insert some lines to get the right output for my timeline.

$clean_content[0] = str_replace("&lt;", "<", $clean_content[0]);
     $clean_content[0] = str_replace("&gt;", ">", $clean_content[0]);
     $clean_content[0] = str_replace("&quot;", "", $clean_content[0]);

But I’ve got a problem: what can I do to output the a tag, with target="_blank"? I know that maybe something in the

echo $clean_content[0];

cause I’ve edited the

echo $prefix_sub;
    if ($show == 1) { echo "<a href=\"" . $clean_uri[0] . "\" target=\"_blank\">" . $clean_name[0] . "</a>" . $wedge; }

by my self outputting the ‘target’ like I said so.

Maybe some ‘if’ statement would work, but I really don’t know how.

I’m really noob about php. Almoust everything I know, I learned working with the Wordpress engine.

I would be very glad if someone could help me with this simple issue.
Thanks in advance!