הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   RSS ב- PHP , עזרה בבקשה. (https://hosts.co.il/forums/showthread.php?t=108881)

EBSites 25-05-15 10:43

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.'';
    }
    
?>


pcnet 26-05-15 12:02

תיכנס לכתובת הבאה ושמה תמצא תיעוד להכל

http://simplepie.org/


כל הזמנים הם GMT +2. הזמן כעת הוא 22:05.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ