- Автор темы
- #1

все хорошо парсит проблема в том что выводит сылки на программы
в виде <a href="/tv/events/14598584/" >Понять. Простить</a>
как можно сделать что бы не показывало в браузере
<a href="/" ></a>
а просто было 'Понять. Простить'.
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.
function block_tags($string){
$replaced_string = str_ireplace('<','<',$string);
$replaced_string = str_ireplace('>','>',$replaced_string);
return $replaced_string;
}
echo block_tags('<a href="/" ></a>'); //Returns <b>HEY</b>
<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// Разрешить теги <p> и <a>
echo strip_tags($text, '<p><a>');
?>
str_ireplace('<','<',$string);
str_ireplace('<','<',$string);
?>[/php]А в твоем коде пиши неаКод:str_ireplace('<','<',$string);
Точки с запятой не хватает после символа.Код:str_ireplace('<','<',$string);
$matches = htmlspecialchars("<a href="/" ></a>", ENT_QUOTES);
$text="<a href=\"/tv/events/14598584/\" >Понять. Простить</a>"; //твоя ссылка в телепрограмме
$text=strip_tags($text); //удалит все тэги
$text=htmlspecialchars($text); //преобразует все левые символы.
$str = '<a href="/tv/135">Понять. Простить</a>';
$cut = str_replace ('<a>', '', $str);
$cut = str_replace ('</a>', '', $cut);
$cut = preg_replace ('#<a\s.*?>#Dis', '', $cut);
$cut = preg_replace ('#</a\s.*?>#Dis', '', $cut);
echo $cut; // Понять. Простить