我正在尝试使用regexp在div中找到eveything.我知道可能有一种更聪明的方法 - 但我选择了regexp.
所以目前我的正则表达式模式如下:
$gallery_pattern = '/<div class="gallery">([\s\S]*)<\/div>/';
Run Code Online (Sandbox Code Playgroud)
它有点诀窍.
问题是如果我有两个divs - 像这样.
<div class="gallery">text to extract here</div>
<div class="gallery">text to extract from here as well</div>
Run Code Online (Sandbox Code Playgroud)
我想从两个div中提取信息,但是在测试时我的问题是我没有得到文本介于其间而是:
"text to extract here </div>
<div class="gallery">text to extract from here as well"
Run Code Online (Sandbox Code Playgroud)
所以总结一下.它会跳过div的第一端.并继续下一个.在div内的文本可以包含<,/和换行.只是你知道!
有没有人有这个问题的简单解决方案?我仍然是一个正则表达新手.
我有一个Facebook页面,我想要页面的提要.我使用graph api来获取访问令牌,但我不知道如何将这个短期访问令牌转换为长期访问令牌
https://graph.facebook.com/oauth/access_token?
client_id=APP_ID& client_secret=APP_SECRET& grant_type=fb_exchange_token& fb_exchange_token=EXISTING_ACCESS_TOKEN
Run Code Online (Sandbox Code Playgroud)
如果上面的链接用于获取长期访问令牌,那么我可以从哪里获得App_Secret
帮助我,如果我采取错误的方法.
我在我的购物车中开发了一个缩放工具,我仍然坚持如何在jQuery函数中调用PHP变量.
这是我的代码:
jQuery(document).ready(function($){
$('#image1').addimagezoom({ // single image zoom
zoomrange: [3, 10],
magnifiersize: [800,300],
magnifierpos: 'right',
cursorshade: true,
largeimage: "php variable" //we add the directory of the image.
});
});
Run Code Online (Sandbox Code Playgroud)
我需要把
$src ="images/products/".mysql_result($execute_select_product_query,0,'image1')."
Run Code Online (Sandbox Code Playgroud)
在我的函数中,我把PHP变量.
https://developers.facebook.com/docs/facebook-login/access-tokens/:
这是我在浏览器中输入的内容:
https://graph.facebook.com/?endpoint&key=value&access_token=[THE APP ID] | [APP SECRET]
这是结果..一条错误消息:
(#803)您请求的某些别名不存在:endpoint
救命!
我想让用户通过Facebook登录.我正在使用此代码:
<?php
require 'include/facebook.php';
require 'include/fbconfig.php';
require 'include/user.php';
$facebook = new Facebook(array(
'appId' => APP_ID,
'secret' => APP_SECRET,
'cookie' => true
));
$session = $facebook->getSession();
if (!empty($session)) {
# Active session, let's try getting the user id (getUser()) and user info (api->('/me'))
try {
$uid = $facebook->getUser();
$user = $facebook->api('/me');
} catch (Exception $e) {
}
if (!empty($user)) {
# User info ok? Let's print it (Here we will be adding the login and registering routines)
echo '<pre>';
print_r($user);
echo …Run Code Online (Sandbox Code Playgroud) 由于Facebook从2013年2月6日开始无法通过Graph API发布到朋友的墙上,我想知道是否有一些替代品要发布到朋友的墙上.
到目前为止,我正在使用Feed API来使用此to参数,但它会抛出异常:
(#200)此应用程序禁用向其他用户发布Feed故事
我找到的可能解决方案是:OG:提及标记.但除了使用OpenGraph之外,有没有办法实现这一目标?请帮忙.
post facebook facebook-wall facebook-graph-api facebook-opengraph
我正在尝试使用facebook graph api从页面配置文件中获取facebook事件.我正在使用的方法如下
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet("https://graph.facebook.com/oauth/access_token?client_id="+APP_ID+"&client_secret="+APP_SECRET+"&grant_type=client_credentials");
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String access_token = client.execute(get, responseHandler);
String uri = "https://graph.facebook.com/PageName/events?"+access_token.replace("|","%7C");
get = new HttpGet(uri);
String responseBody = client.execute(get, responseHandler);
Run Code Online (Sandbox Code Playgroud)
其中APP_ID,APP_SECRET和PageName我将替换为我的详细信息.它的工作没有问题,我也得到了来自Facebook的响应作为json数组,其中包括name,start_time,end_time,timezone,location,事件的id,但是没有事件描述.
如何解决这个问题?
events android facebook facebook-graph-api facebook-android-sdk
因为我不希望回退流程从iOS6登录对话框开始,我用过
[FBSession.activeSession openWithBehaviour: completionHandler]
Run Code Online (Sandbox Code Playgroud)
但不知道在那里我可以添加的权限参数,就像@"basic_info"和@"user_like"下面的方法-
[FBSession openActiveSessionWithReadPermissions:@[@"basic_info", @"user_like"]
allowLoginUI:YES
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// Respond to session state changes,
// ex: updating the view
}];
Run Code Online (Sandbox Code Playgroud)
谢谢你的建议.
我想使用我已生成的访问令牌获取用户配置文件,如果访问令牌无效,则显示错误.有人可以帮忙吗?我想要PHP代码来处理这个问题.我在等....
php facebook facebook-graph-api facebook-php-sdk facebook-access-token
我有一个名为“mig”的数据库。它有10张桌子。现在我想在另一个系统中创建相同的数据库,所以我使用mysqldump命令但它显示错误。
我输入命令如下:
mysqldump -u root -p root mig >file.sql;
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
ERROR 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在第 1 行“mysql dump -u root -p root mig >file.sql”附近使用的正确语法
当我使用时,我遇到同样的错误,
mysqldump -u root -proot mig >file.sql;
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题 ?