Are you talking about something like
<?php echo '<img src="my_image.jpg">; ?>
If so, use a slash to get to the url root and then use the full path from there like
<?php echo '<img src="/images/my_image.jpg">; ?>
Otherwise your urls can be messed up easily.