All pastes #525951 Raw Edit

Someone

public text v1 · immutable
#525951 ·published 2007-05-31 16:26 UTC
rendered paste body
<?php

    // Get the XML data from Feedburner
    $xml = simplexml_load_file('http://www.sportsnet.ca/rss/homepage.xml');
$text_out = explode(" ", $text);
  
 $font_regular = "/usr/share/fonts/truetype/cisco/CISCOLIG.TTF";
   
     // $size_regular = ‘10&#8242;;
  
    // word_wrap() function.
    function word_wrap($text) {
        // Define the characters to display per row
        $chars = "20";
        $text = wordwrap($text, $chars, " " , 1);
        return $text;
    }
    
    
    function wrap_word($text) {
        // we'll try using explode() instead of wordwrap()
        
        return $text_out;
    }

    // Parse each item in the RSS feed
    foreach ($xml->channel[0]->item as $item) {
        if($item) {
            $title = strip_tags($item->title);
            $description = strip_tags($item->description);              
        
            $img = imagecreatefromgif('cisco.gif');      
            $color = imagecolorallocate($img, 0x00, 0x66, 0xCC);
$txt_color = imagecolorallocate($img, 0x12 ,0x07 ,0x07 );
            $text = word_wrap($description);
            //
            
            
           // imagestring($img, 3, 1, 2, $title, $color);
            //$title=explode(" ",$title);
           $value= explode(" ",$text,16);
            //$str =  array($value);
        //$white = imagecolorallocate( $image, 255, 255, 255 );       
     
imagettftext( $img , 9 , 0 , 8, 70, $txt_color , $font_regular, $title );
//imagettftext( $img , 9 , 0 , 8, 70, $txt_color , $font_regular, $description);            
//imagestring($img, 1 , 1, 50 ,$title, $color);
//imagestring($img, 1, 1, 60, $value , $color);
            echo "<html><head>\n<title>Test Text to Image</title>\n";
            echo "</head><body>\n";
            
            
            if(!imagegif($img, 'feedburner-readers.gif')) {
                echo "<p>Image not created!</p>";
            } else {
                echo '<img src="feedburner-readers.gif" />';
            }
            
            echo "\n</body></html>";
   
            exit;


        }    
    }
?>