<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="test">dasadasdas</div>
<?php
$html_text = '<html><body><div class="test"></div></body></html>';
$text = "";
if (preg_match("#<div class=\"test\">(.*?)</div>#si", $html_text, $regs))
{
$text = $regs[1];
}
var_dump($text);
?>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="test">dasadasdas</div>
<?php
$html_text = "<html><body></body></html>";
$text = "";
if (preg_match("#<div class=\"test\">(.*?)</div>#si", $html_text, $regs))
{
$text = $regs[1];
}
var_dump($text);
?>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="test">dasadasdas</div>
<?php
$text = "";
if (preg_match("#<div class=\"test\">(.*?)</div>#si", $html_text, $regs))
{
$text = $regs[1];
}
echo $text;
?>
</body>
</html>
$( ".product-cat" ).hover(function(){
$( this ).toggleClass( "cat-hover" )
var link = $( this ).find('.product-text-link');
link.css('color','#f85e22');
},function() {
$( this ).removeClass( "cat-hover" );
var link = $( this ).find('.product-text-link');
link.css('color','#000000');
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="jquery-3.5.1.min.js"></script>
<script src="load-case.js"></script>
</head>
<body>
<div class="grid-container case-page-image news-case">
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="jquery-3.5.1.min.js"></script>
<script src="load-case.js"></script>
</head>
<body>
<div class="grid-container case-page-image">
<div class="grid utility-model">Пример utility-model</div>
<div class="grid industrial-design">Пример industrial-design</div>
<div class="grid copyright">Пример copyright</div>
<div class="grid industrial-design">Пример industrial-design</div>
<div class="grid invention">Пример invention</div>
<div class="grid copyright">Пример copyright</div>
<div class="grid utility-model">Пример utility-model</div>
<div class="grid industrial-design">Пример industrial-design</div>
<div class="grid invention">Пример invention</div>
<div class="grid copyright">Пример copyright</div>
</div>
</body>
</html>
$( document ).ready(function() {
$arr = $('.grid-container div');
let foDiv = [...$arr.slice(-4, $arr.length)].map(item => item.outerHTML).join(' ');
//сохраняем в localStorage
localStorage.setItem('foDiv', foDiv);
//на след странице вытаскиваем с localStorage html
$('.news-case').text(localStorage.getItem('foDiv'));
});
Facebook
Вк
Telegram