I have a simple form where you can upload an html file, its structure looks like this:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="he" xml:lang="he" dir="rtl">
<head>
<title>test</title>
<link rel="stylesheet" href="../Styles/cssreset-min.css" type="text/css"/>
<link rel="stylesheet" href="../Styles/page_styles.css" type="text/css"/>
<link rel="stylesheet" href="../Styles/style.css" type="text/css"/>
</head>
<body id="start">
<img src="../Images/cover.jpg" class="images" alt="Image 1"/>
</body>
</html>
I'm interested in the server-side coding of editing the HTML file, how do I load it, find the img tag and replace it with <svg>
tag (for example) and save the html file with the same name and extension.
I've tried a number of times but I seems to get confused with with all the different methods out there.
This solution needs to be cross-browser compatible and don't use any dependency if possible, e.g. I tried using <kbd>RecursiveTreeIterator</kbd> once and my hosting company was blocking it from running.
Thanks