Answer the question
In order to leave comments, you need to log in
How to clear the html table obtained from excel from garbage?
You need to remove classes, inline styles, tag attributes.
Leave only content + hyperlinks.
I tried online tools - those that were more or less suitable for some reason removed links along with the garbage, but I need them
Answer the question
In order to leave comments, you need to log in
Thank you all for participating! Understood:
<?php
$content = file_get_contents('table.html');
$table = preg_replace("/<([a-z][a-z0-9]*)(?:[^>]*(\shref=['\"][^'\"]*['\"]))?[^>]*?(\/?)>/i",'<$1$2$3>', $content);
?>
<body>
<?=$table?>
</body>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question