The easiest way to draw a line (you want it in php? you got it 😉 ):
echo '<div class="layer1"><hr></div>';
It has some drawbacks though 🙂. It can only draw horizontal lines.
More sophisticated way is to draw a line in a dynamically created image and insert image in your file:
<?php
//in your index.php
echo '<div class="layer1"><img src="image.php?parameter=some_param"></div>';
?>
<?php
$parameter = $_GET['parameter'];
/*in image.php
- create png image of a desired size (basing on your parameters)
-allocate some colors (background color for transparency for sure)
- draw a line (again, in parameters you can define length, angle and use some math to draw a line the way you want)
- send headers for png file
- send the image you've created
*/
?>
As you see, this is just some concept. You can search for graphic functions in manual: [man]image[/man]. There are some examples there to help you.