$controller = 'TestControllers';
$className = '\App\Controllers\\'.$controller;
$test = new $className();
$('textarea').on('keyup', function () {
var start = $.trim($(this).val()).split(/\s+/g);
for (var i = 0, result = [], _result = {}, stroke; i <= start.length; i++) {
for (var j = 0; j < i; j++) {
stroke = $.trim(start.slice(j, j + start.length - i + 1).join(' '));
if (!_result[stroke]) {
_result[stroke] = result.push(stroke);
}
}
}
$.post('go.php', {search: JSON.stringify(result)}, function (a) {
$('pre').html(a);
});
});
$('textarea').on('keyup', function () {
var string = $.trim($(this).val()),
xooon = string.split(/\s+/g),
go = [],
indysiii = [];
for (var astraaa = 0, xooonLength = xooon.length; astraaa <= xooonLength; astraaa++) {
for (var bond = 0; bond < astraaa; bond++) {
var ccc = $.trim(xooon.slice(bond, xooonLength - astraaa + 1).join(' '));
if (ccc != '' && !(indysiii[ccc])) {
indysiii[ccc] = true;
go.push(ccc);
}
}
}
$.post('go.php', {search: JSON.stringify(go)}, function (a) {
$('pre').html(a);
});
});
$('textarea').on('keyup', function () {
var string = $(this).val(),
xooon = string.split(' '),
go = [],
indysiii = [];
for (var astraaa = 0, xooonLength = xooon.length; astraaa <= xooonLength; astraaa++) {
for (var bond = 0; bond < astraaa; bond++) {
var ccc = xooon.slice(bond, xooonLength - astraaa + 1).join(' ');
if (ccc != '' && !(indysiii[ccc])) {
indysiii[ccc] = true;
go.push(ccc);
}
}
}
$.post('go.php', {search: go}, function (a) {
$('pre').html(a);
});
});
<?php
$_POST['search'] = json_decode($_POST['search'] , true);
print_r($go);
$.post('go.php', {search: go}, function(a){ $('pre').html(a) });
$_POST['search'] = json_decode($_POST['search'] , true);
$.post("go.php",{
search:$("textarea").val() // search это $_POST['search']
},function(a){$("pre").html(a)})
string = 'Привет мир как у тебя дела'
$ages = array_column($arr, 'age');
$results = array_multisort($ages, SORT_DESC, $arr);
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^www][a-z]+)\.example.com [NC]
RewriteRule ^robots.txt /robots_%1.txt [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^www][a-z]+)\.example.com [NC]
RewriteRule ^robots.txt /robots.php?lang=%1 [L]
</IfModule>
var string = 'Привет мир как у тебя дела',
xooon = string.split(' '),
go = [],
indysiii = [];
for (var astraaa = 0, xooonLength = xooon.length; astraaa <= xooonLength; astraaa++) {
for (var bond = 0; bond < astraaa; bond++) {
var ccc = xooon.slice(bond, xooonLength - astraaa + 1).join(' ');
if (ccc != '' && !(indysiii[ccc])) {
indysiii[ccc] = true;
go.push(ccc);
}
}
}
var result = $("#result");
for (var i in go) {
result.append('<div>' + go[i] + '</div>');
}
И второе с float работать медленнее, чем с int, примерно в 5-6 раз.