$result = $mysqli->query("SELECT * FROM `entry` WHERE `descr` LIKE '%{$query}%' OR `content` LIKE '%{$query}%' OR `title` LIKE '%{$query}%'");
<?php
header( 'Content-Type: text/html; charset=utf-8' );
$xml = 'http://lenta.ru/rss/top7';
$rss = simplexml_load_file( $xml );
foreach( $rss->channel->item as $key => $item )
{
if( $key == 4 )
return;
$news_title = $item->title;
$news_link = $item->link;
echo $news_link;
echo $news_title;
}
?>
<script type="text/javascript" src="//api-maps.yandex.ru/2.0/?load=package.standard&lang=ru-RU" ></script>
<script type="text/javascript">
maps.ready(init);
var myMap;
function init()
{
myMap = new ymaps.Map("map",
{
center: [55.7491, 37.6162],
zoom: 12,
behaviors: ["default", "scrollZoom"]
},
{
balloonMaxWidth: 300
});
myMap.events.add("click", function(e)
{
var coords = e.get("coordPosition");
alert( "Координаты: " + [coords[0].toPrecision(10),coords[1].toPrecision(10)].join("; ") );
});
myMap.controls.add("searchControl");
myMap.controls.add("zoomControl");
myMap.controls.add("mapTools");
myMap.controls.add("typeSelector");
}
</script>
<div id="map" style="width:100%; height:500px"></div>
var tags = $('#tags')
tags.tagsinput();
tags.tagsinput('input').typeahead({
remote: "http://example.ru?query=%QUERY"
}).bind('typeahead:selected', $.proxy(function (obj, datum) {
tags.tagsinput('add', datum.value);
tags.tagsinput('input').typeahead('setQuery', '');
}, $('input')));
$arr = array('word1', 'word2', 'word3');
$n = count($arr);
for ($i = 1; $i <= $n; $i++) {
$pos[$i] = $i-1;
$c[$i] = 1;
$pr[$i] = 1;
}
$c[$n] = 0;
foreach($pos as $p)
echo $arr[$p],' ';
echo "<br>";
$i = 1;
while ($i < $n) {
$i = 1;
$x = 0;
while ($c[$i] == $n-$i+1) {
$pr[$i] = 1-$pr[$i];
$c[$i] = 1;
$x += $pr[$i];
$i++;
}
if ($i < $n) {
$k = $pr[$i] ? $c[$i]+$x : $n-$i+1-$c[$i]+$x;
$t = $pos[$k];
$pos[$k] = $pos[$k+1];
$pos[$k+1] = $t;
foreach($pos as $p)
echo $arr[$p],' ';
echo "<br>";
$c[$i]++;
}
}
word1 word2 word3
word2 word1 word3
word2 word3 word1
word3 word2 word1
word3 word1 word2
word1 word3 word2
function combinations($words)
{
if (count($words) == 1) {
return [$words];
};
$combinations = [];
$i = 0;
do {
$first_word = array_shift($words);
foreach (combinations($words) as $cmb) {
$combinations[] = array_merge([$first_word], $cmb);
};
array_push($words, $first_word);
} while (++$i < count($words));
return $combinations;
};
$combinations = combinations(explode(' ', 'word1 word2 word3 word4'));
print_r($combinations);
$("div.right").click(function()
{
if (i === slides.length - 1 || i == 0 ) { return; }
slides.eq(i - 1).trigger("activate").trigger("moveend");
});
$("div.left").click(function()
{
if (i === slides.length - 1) { return; }
slides.eq(i + 1).trigger("activate").trigger("moveend");
});
echo "SELECT SQL_NO_CACHE * FROM content WHERE category = 'new' AND title LIKE '%".mysql_real_escape_string($search)."%' GROUP BY thumb ORDER BY id DESC LIMIT $p, $limit";