I have two php scripts in the same directory-a.php and b.php . b.php creates an images and displays it.(Example here).
a.php
<html>
<body>
<img src=<?php echo "b.php";?> alt="image"/>
</body>
</html>
Both <?php echo "b.php";?> and <?php echo "http://localhost/b.php";?> work. But I want to know which will display the image faster? Or both will be the same?
They should both be the same, as your browser would make a new request for the picture anyway, however I’d suggest you to always use
b.php, or another kind of relative path instead of the full (absoloute) path (UNLESS the picture is on another server, of course).