From the URL, let's say google.com/web1.php I would like to grab the part between the last slash and the extension, so: "web1" and then use it to point the specific image. Here is the example:
for url: google.com/web1.php
<img src="web1.jpg">
for url: google.com/web2.php
<img src="web2.jpg">
I know how to insert the whole URL, but don't know how to get a part of it. Here is what I use for the whole URL:
<img src="<?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>.jpg"/>
How to get only the part I want instead of the whole URL? Thanks