var new_data = $(data).find('#content').html();
var new_data = '';
new_data += '<div>Какой-то свой код</div>';
new_data += $(data).find('#some-block').html(); // Вместо #some-block можно использовать любой селектор
new_data += '<p>Еще немного своего кода</p>';
new_data += $(data).find('#content').html();
// Функция для превращения путей в древовидный массив
function pathsToTree(array $paths, $separator="/") {
$pathsTree = [];
foreach ($paths as $path) {
$pathParts = array_reverse(explode($separator, $path));
$pathTree = [];
foreach ($pathParts as $i=>$pathPart) {
if (empty($pathPart)) {
continue;
}
$pathTree = ($i == 0 ? [$pathPart] : [$pathPart => $pathTree]);
}
$pathsTree = array_merge_recursive($pathsTree, $pathTree);
}
return $pathsTree;
}
// Пример использования
$testPaths = [
'/dir1/sdir1/file',
'/dir1/sdir2/sdir3/file',
'/dir2/sdir1/file'
];
var_dump(pathsToTree($testPaths));
/* Результат:
array(2) {
["dir1"]=>
array(2) {
["sdir1"]=>
array(1) {
[0]=>
string(4) "file"
}
["sdir2"]=>
array(1) {
["sdir3"]=>
array(1) {
[0]=>
string(4) "file"
}
}
}
["dir2"]=>
array(1) {
["sdir1"]=>
array(1) {
[0]=>
string(4) "file"
}
}
}
*/
while($row = $qwe->fetch()) {
$wall = file_get_contents("https://api.vk.com/method/wall.get?v=5.4&filter=owner&count=1000&owner_id=-".$row['id']);
$wall = json_decode($wall);
$wall = $wall->response->items;
// Удаление элементов, которые не подходят под условие
$wall = array_filter($wall, function($entry) {
return ($entry->post_type == 'post' && $entry->is_pinned !== -1);
});
// Переиндексация массива, чтобы ключи шли по порядку
$wall = array_values($wall);
$i = mt_rand(1, count($wall));
$repost = file_get_contents("https://api.vk.com/method/wall.repost?v=5.4&object=wall-".$row['id']."_".$wall[$i]->id."&group_id=".$gid."&access_token=".$token);
$repost = json_decode($repost);
sleep(mt_rand(25, 45));
}
$array = array_filter($array, function($element) use ($query) {
return (strpos($element, $query) !== false);
});
$.getJSON('ССЫЛКА',{},function (data) {
var html = '';
data.gallery.kadr.forEach(function(element) {
html += '<img src="ссылка' + element.image + '">';
})
document.getElementById("kadri").innerHTML=html;
});
var autoChanger = setInterval(function() {
var container = $('.liTabs1');
var tabs = container.find('.t_link');
var currentTab = container.find('.t_link.cur');
var nextTab = tabs.eq(currentTab.parent().index()+1);
if (nextTab.length == 0) {
nextTab = tabs.eq(0);
}
nextTab.click();
}, 1000);
phone=1111111&phone=2222222222
['phone'=>2222222222]
LOAD DATA INFILE 'C:\sixkwords.csv' INTO TABLE slovar (word)
LINES TERMINATED BY '\n';
SELECT
user.`id`,
user.`login`,
COALESCE(salary_table.`money_sum`, 0)-COALESCE(spending_table.`money_sum`, 0) AS 'sum'
FROM
`user`
LEFT JOIN (
SELECT
salary.user,
SUM(salary.`money`) AS 'money_sum'
FROM salary
GROUP BY salary.`user`
) salary_table ON salary_table.`user`= user.`id`
LEFT JOIN (
SELECT
spending.user,
SUM(spending.`money`) AS 'money_sum'
FROM spending
GROUP BY spending.`user`
) spending_table ON spending_table.`user`= user.`id`
GROUP BY user.`id`