小编use*_*607的帖子

从 RSS 提要中使用 php 抓取图像

PHP

$rss = new DOMDocument();
$rss->load('http://www.autoexpress.co.uk/feeds/all');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
  $item = array (
    'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
    'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
    'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
    'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
    'image' => $node->getElementsByTagName('whattagdoiaddhere')->item(0)->nodeValue,
  );
  array_push($feed, $item);
}
$limit = 3;
for($x=0;$x<$limit;$x++) {
  $title = str_replace(' & ', ' &amp; ', $feed[$x]['title']);
  $link = $feed[$x]['link'];
  $description = $feed[$x]['desc'];
  $date = date('l F d, Y', strtotime($feed[$x]['date']));
  echo '<div class="news-row-index">';
  echo '<div class="img"><a href="'.$link.'" target="_blank" title="'.$title.'"><img src="'.$image.'" height="79" width="89"></a></div>';
  echo '<div class="details-index"><p><h5><a href="'.$link.'" …
Run Code Online (Sandbox Code Playgroud)

php rss

3
推荐指数
1
解决办法
4467
查看次数

如何在Excel中包含数据的每一行之后插入特定值?

我试图在使用宏在Excel中具有数据的每一行之后的新行中插入特定值.我在网上找到了以下脚本,但是这个脚本只插入一个空行.我需要hello在每个数据行之后插入一个带有值的新行.

Sub addrowwithvalue()
  m = Range("a1").CurrentRegion.Rows.Count
  For i = m To 2 Step -1
    Cells(i, 1).EntireRow.insert
    Next
End Sub
Run Code Online (Sandbox Code Playgroud)

预期产量:

row1
hello
row2
hello
row3
hello
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

1
推荐指数
1
解决办法
1896
查看次数

警告:chmod():无法为非标准流调用chmod()

我试图在PHP中将文件权限更改为0777,但我收到此错误: Warning: chmod(): Can not call chmod() for a non-standard stream 我尝试过chmod但不起作用.

$imagethumb = 'http://'.$root.'/scrapers/thumbnails/'.$copiedimage;
    //looks like http://domain.com/scrapers/thumbnails/image.jpeg
chmod($imagethumb, 0777);
Run Code Online (Sandbox Code Playgroud)

请让我知道我错在哪里.

php

-1
推荐指数
1
解决办法
3449
查看次数

标签 统计

php ×2

excel ×1

excel-vba ×1

rss ×1

vba ×1