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.
$string='<div id="content">tekst</div>';
$cstring=explode('<div id="content">', $string);
$cstring=explode('</div>', $cstring[1]);
echo $cstring[0];
text text text s html tagove
<div id="content">
text s html tagove
</div>
oshte text s html tagove
$text = 'text text text s html tagove
<div id="content">
text s html tagove
</div>
oshte text s html tagove';
$content = preg_replace('/(<div\sid=\"content\">)[^<]+(<\/div>)/i', '$1$2', $text);
var_dump($content);
string(86) "text text text s html tagove
<div id="content"></div>
oshte text s html tagove"
$content = preg_replace('/(<div\sid=\"content\">)[^<]+(<\/div>)/i', ' ', $text);
cold_zero каза:Всичко точно, но ако в div-a нямам тагове, а чист текст не го показва...