View Single Post
ישן 25-05-15, 10:43   # 1
EBSites
חבר מתקדם
 
EBSites's Avatar
 
מיני פרופיל
תאריך הצטרפות: Jul 2008
הודעות: 383

EBSites לא מחובר  

RSS ב- PHP , עזרה בבקשה.

אהלן ,

הייתי מעוניין שהיה שדה לתמונה בנפרד ולא ביחד עם התיאור של הכתבה, איך עושים זאת?
אשמח לעזרה בבקשה.

PHP קוד:
    <?php
    $rss 
= new DOMDocument();
    
$rss->load('http://www.ynet.co.il/Integration/StoryRss2.xml');

    
$feed = array();
    foreach (
$rss->getElementsByTagName('item') as $node) {
    
$item = array (
    
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,

    
'image' => $node->getElementsByTagName('image')->item(0)->nodeValue,

    
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
    
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
    
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
    );
    
array_push($feed$item);
    }
    
$limit 1;
    for(
$x=0;$x<$limit;$x++) {
    
$title str_replace(' & '' &amp; '$feed[$x]['title']);

    
$image $feed[$x]['image'];

    
$link $feed[$x]['link'];
    
$description $feed[$x]['desc'];
    
$description explode(' '$description5);
    
$description implode(" ",$description);
    
$date date('m,d,Y'strtotime($feed[$x]['date']));
    echo 
'<strong><a target="_blank" href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
    echo 
'<img src="'.$image.'" width="100" height="100" alt="עדכוני חדשות">';
    echo 
''.$description.'';
    }
    
?>
  Reply With Quote