小编Hao*_*ung的帖子

Laravel-未定义的变量:请求

我的http:// localhost:8888 / VGL / public / category / 18?sty = 3

dd($request->sty);等于3

但是我把$request->stywhereHas

未定义的变量:请求

public function show(Request $request, $id)
{
    $products = Product::with('features')
        ->whereHas('features', function ($q) {
            return $q->where('id', $request->sty);
        })
        ->where('category_id',17)
        ->get();
}
Run Code Online (Sandbox Code Playgroud)

get-request laravel undefined-variable

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

在php中从具有某些特定模式前后的字符串中提取数字

我知道那里有很多帖子,但我真的找不到任何匹配项。我有一个字符串 "com/i598816441262.htm?sourceType=item&ttid=227200"

我想提取 'i' 和 '.' 之后的数字,在示例中为 598816441262,我可以针对整个内容,“/i598816441262”。但我只想要数字,如果我能做一次,我不想做两次。

求求各位大大给点建议!

php regex

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

标签 统计

get-request ×1

laravel ×1

php ×1

regex ×1

undefined-variable ×1