<div class="list-group">
<?php
$query = "SELECT DISTINCT(brand) FROM all_brands";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach($result as $row) {
?>
<div class="list-group-item checkbox">
<label>
<input type="checkbox" class="common_selector brand" value="<?php echo $row['brand']; ?>" >
<?php echo $row['brand']; ?>
</label>
</div>
<?php } ?>
</div>
for ($i = 2; $i < 5; $i++) {
// поиск по ключевому слову
$a = file_get_contents("index-$i.html");
$a = preg_split("~\\n(?=\\s+)~", $a);
$word = 'Игра на ';
print_r(preg_grep("~$word~ui", $a));
}
function getArticles($page) {
global $articles;
}
// вывод информации
for ($i = 2; $i < 5; $i++) {
$page = new simple_html_dom();
$page->load_file("index-$i.html");
$items = $page->find('div.text');
foreach($items as $post) {
// comment
$articles[] = array($post);
print_r($post->outertext);
}}