1
我有使用preg_match一些問題,而不是選擇1件事。它從第一個開始到最後一個結束。PHP preg_match只有一個匹配
preg_match('/@section\(\'(.*)\'\)(.*)@endsection/s', $content,$results
$內容:
@section('title')
Number 1
@endsection
@section('content')
Number 2
@endsection
但是,當我使用的preg_match,結果出來,如:
Number 1
@endsection
@section('content')
Number 2