小编Zac*_*ter的帖子

PHP SimpleXML命名空间问题

我正在尝试获取RSS提要中每个条目的entry-> id和entry-> cap:parameter->值....下面是我正在使用的代码.它正确显示id,但它没有显示值字段....请帮忙.

$url = 'http://alerts.weather.gov/cap/us.php?x=1';
$cap = simplexml_load_file($url);
foreach($cap->entry as $entry){
    echo 'ID: ', $entry->id, "\n";
    echo 'VTEC: ', $entry->children('cap', true)->parameter->value, "\n"; 
echo "<hr>";
}
Run Code Online (Sandbox Code Playgroud)

我在这里先向您的帮助表示感谢.

php xml simplexml

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

使用API​​发布链接不包括图片,标题或Meta Desc PHP

使用API​​发布时,我会收到:

https://www.facebook.com/weather.warnings/posts/329128793830700

注意事物中缺少标题,缩略图和元描述.

以下是我正在使用的代码.

$allalert = array
(
'oauth_token' => 'not pasting this thanks :P',
'message' => "New $type for $where",
'link' => $url,
);
$sendalert = $facebook->api('/125291287567922/links/','POST',$allalert);
Run Code Online (Sandbox Code Playgroud)

引用一个人如何张贴缩略图到一个网站/链接对象?它说该项目从页面本身拉出图片

想法?

php facebook facebook-wall facebook-graph-api facebook-php-sdk

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