function display_rss_array($rss_array)
{
    // var_dump($rss_array);
    ?>
    <table border="0">
        <!-- Display the article title and copyright notice -->    
        <tr><td><font size="+1"><b><?php 
    echo strip_cdata_tags($rss_array['TITLE']);
    ?>
</b></font></td></tr>
        <tr><td><?php 
    echo strip_cdata_tags($rss_array['COPYRIGHT']);
    ?>
</td></tr>

        <!-- Display the article descriptions and links -->    
		
        <?php 
    for ($xx = 0; $xx < count($rss_array['ITITLE']); $xx++) {
        ?>
            <tr>
                <td>
                    <a href="<?php 
        echo strip_cdata_tags($rss_array['ILINK'][$xx]);
        ?>
">
                        <b><?php 
        echo strip_cdata_tags($rss_array['ITITLE'][$xx]);
        ?>
</b>
                    </a>
                </td>
            </tr>
            <tr>
                <td><?php 
        echo strip_cdata_tags($rss_array['IDESCRIPTION'][$xx]);
        ?>
</td>
            </tr>
            <tr>
                <td><font size="-1"><?php 
        echo strip_cdata_tags($rss_array['IPUBDATE'][$xx]);
        ?>
</font></td>
            </tr>
          <?php 
    }
    ?>
    </table>
<?php 
}
示例#2
0
function xml_escape_array($in_data)
{
    if (is_array($in_data)) {
        foreach ($in_data as $key => $item) {
            $in_data[$key] = xml_escape_array($item);
        }
        return $in_data;
    } else {
        if ($in_data !== '' && !is_numeric($in_data)) {
            return '<![CDATA[' . strip_cdata_tags($in_data) . ']]>';
        } else {
            if (is_numeric($in_data)) {
                return $in_data;
            } else {
                return false;
            }
        }
    }
}