I'm trying to convert a large website into PHP. All the files have almost similar head/header portion and footer section.
I'm trying to unify all these header section, and footer section by putting it into a seperate file.
So I need to replace all of my
- header section (which spans anywhere from 1045 to 1535 lines) with
<?php include_once "include/header.php" ?>
And
- footer section (which spans anywhere from 80 to 140 lines) with
<?php include_once "include/footer.php" ?>
from all the files in a directory..
This is a rough figure of what I need to do.. Please look the code below..
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="">
<meta name="description" content="">
<meta name="author" content="">
<title></title>
<link rel="apple-touch-icon" href="">
<link rel="shortcut icon" href="">
<!-- Stylesheets -->
<link rel="stylesheet" href=""> <!-- Some Stylesheets -->
<link rel="stylesheet" href=""> <!-- Some Stylesheets -->
<link rel="stylesheet" href=""> <!-- Some Stylesheets -->
<!-- Scripts -->
<script src=""></script>
</head>
<body class="">
<nav class="nav1" role="navigation">
<!-- Some HTML -->
</nav>
<div class="menubar1">
<!-- Some HTML -->
</div>
<div class="menubar2">
<!-- Some HTML -->
</div>
<!-- ========================================================= -->
<!-- ========================================================= -->
<!-- PAGE CONTENTS -->
<!-- ========================================================= -->
<!-- ========================================================= -->
<!-- Footer -->
<footer class="site-footer">
<!-- Some HTML -->
</footer>
<script src=""></script> <!-- Some Script Tags -->
<script src=""></script> <!-- Some Script Tags -->
<script src=""></script> <!-- Some Script Tags -->
<script src=""></script> <!-- Some Script Tags -->
<!-- Page -->
<!-- Google Analytics -->
<script>
/* Some Scripts */
</script>
</body>
</html>
In the above given code, I need to replace everything from top to
<div class="menubar2">
(Until it's closing Tag) with
<?php include_once "include/header.php" ?>
Also, I need to replace everything below footer
with
<?php include_once "include/footer.php" ?>
Please help me replace that portion of the file with my string..
Thanks in advance