Firstly I'm very new to web development so forgive me if this is a stupid or repeated question.
All my web pages have the same header so I simply add the following line to the top of every page:
<?php require('header.html') ?>
This works fine. But now I'd like to vary the image in the header depending on which page it is on. I'm thinking about using a php function like this:
function create_header($image){
//1. echo contents of header.html
//2. replace default image location with $image if not null
}
Problem is I don't know how to do steps 1 or 2. Is this possible and/or is there a better way of doing what I want?