Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
$word = "Нови";
$site = "http://site.com/news.php";
$content = @file_get_contents("$site") or die("Не мога да отворя сайта");
if(preg_match("/$word/i","$content")) mysql_query("INSERT INTO words (`word`) VALUES ('$word')");
?>
CREATE TABLE IF NOT EXISTS `words`(
`id` INT NOT NULL AUTO_INCREMENT,
`word` TEXT COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY(`id`)
) ENGINE = MyISAM DEFAULT CHARSET utf8 COLLATE utf8_unicode_ci AUTO_INCREMENT = 1;
firestarteR1 каза:пример
<?php
$arrWords[0] = "Нови";
$arrWords[1] = "Твой";
$arrWords[2] = "Мой";
$arrWords[3] = "Всички";
$site = "http://site.com/news.php";
fireach($arrWords as $strWord){$content ='';
$content = @file_get_contents("$site") or die("Не мога да отворя сайта");
if(preg_match("/$strWord/i","$content")) mysql_query("INSERT INTO words (`word`) VALUES ('$word')");
}
Това е само пример!!!
Добре е да сложиш едно селектиране което да проверява в базата данни завече въведена новина.
?>
<?php
$words= array("Нови","дума","<td>Нови</td>"); # от тук със запетаи задаваш колкото искаш думи
$site = "http://site.com/news.php";
$content = @file_get_contents("$site") or die("Не мога да отворя сайта");
foreach($words as $word){
if(preg_match("/$word/i","$content")) mysql_query("INSERT INTO words (`word`) VALUES ('$word')");
}
?>
<?php
$words= array("Нови","дума","<td>Нови<\/td>"); # от тук със запетаи задаваш колкото искаш думи
$site = "http://site.com/news.php";
$content = @file_get_contents("$site") or die("Не мога да отворя сайта");
foreach($words as $word){
if(preg_match("/$word/i","$content")) mysql_query("INSERT INTO words (`word`) VALUES ('$word')");
}
?>