<?=base_url()?> images/2.jpg
<?=base_url()?> / images/2.jpg
<?php echo '<img src="' . base_url() . 'images/2.jpg" alt="whatever" />'; //unless you really meant to have that question mark between your base url and 'images'. and if that is the case then do this: echo '<img src="' . base_url() . '?images/2.jpg" alt="whatever" />'; //this assumes you have an image directory called 'images' that is located at root.
<?php echo site_url("/images/2.jpg"); ?>
<?php echo site_url("/images/2.jpg"); ?> //produces: http://domain.tld/index.php/images/2.jpg