我试图使用XPath string-after来获取Property ID之后的数据:但是结果不是我想要的,它显示了所有与Property ID匹配的结果。我只想要P-000324。这是我的代码
<?php
$getURL = file_get_contents('http://realestate.com.kh/residential-for-rent-in-phnom-penh-daun-penh-phsar-chas-2-beds-apartment-1001192296/');
$dom = new DOMDocument();
@$dom->loadHTML($getURL);
$xpath = new DOMXPath($dom);
echo $xpath->evaluate("normalize-space(substring-after(., 'Property ID:'))");
Run Code Online (Sandbox Code Playgroud)
那么我怎样才能使它只获得第一个结果?
我正在使用 Strapi 构建 Graphql api。这是一个简单的应用程序,用户可以注册并保存他/她的一些信息。我有两个表,用户[由 Strapi 提供]和个人资料,我用它来存储用户附加信息。两个表有关系
用户 [User has and belongs to one Profile]
轮廓 Profile has and belongs to one User和接触部件结构。
我希望能够从配置文件表中获取当前登录的用户及其信息,但我保存为组件类型的联系人字段返回 null。
这是我到目前为止正在做的事情
扩展/用户权限/config/schema.graphql.js
module.exports = {
definition: `
extend type UsersPermissionsMe {
profile: ProfileMe
}
type ProfileMe {
id: ID!
website: String!
description: String!
contact: ContactMe
}
type ContactMe {
id: ID!
name: String!
phone: String!
email: String!
}
`
}
Run Code Online (Sandbox Code Playgroud)
扩展/用户权限/服务/User.js
'use strict';
module.exports = {
fetchAuthenticatedUser(id) {
return strapi.query('user', 'users-permissions').findOne({ id }, ['role', …Run Code Online (Sandbox Code Playgroud) 我是 flutter 的新手,目前我正在开发一个在线游戏应用程序。在主页中,我实现了显示游戏类别的图像滑块和网格视图。我想在网格视图周围添加垂直和水平线,如附加的图像,我尝试添加分隔线,但结果与我想要的不同。
我想做同样的这张图片
https://dribbble.com/shots/6913576-Papricon-Premium-Icons-from-Paperpillar/attachments
我真的不知道怎么画这样的线。
这是我试图实现的一些代码
_buildGameCategory() {
List<Map<String, dynamic>> games = [
{
"title": AppMenu.sport,
"page": "Sport",
"icon": AppImages.icon_sport,
},
{
"title": AppMenu.live_casino,
"page": "LiveCasino",
"icon": AppImages.icon_casino,
},
{
"title": AppMenu.virtual_sport,
"page": "VirtualSport",
"icon": AppImages.icon_sport,
},
{
"title": AppMenu.game,
"page": "Games",
"icon": AppImages.icon_casino,
},
{
"title": AppMenu.game,
"page": "Games",
"icon": AppImages.icon_casino,
},
{
"title": AppMenu.game,
"page": "Games",
"icon": AppImages.icon_casino,
}
];
return GridView.count(
shrinkWrap: true,
crossAxisCount: 3,
padding: EdgeInsets.all(Constant.sizeMedium),
crossAxisSpacing: Constant.sizeSmall,
mainAxisSpacing: Constant.sizeSmall,
physics: BouncingScrollPhysics(),
children: games.map((category) { …Run Code Online (Sandbox Code Playgroud)