PHP img alt属性[重复]

This question already has an answer here:

I want to include an image alt attribute using PHP.

I currently have the following code...

    <?php echo img(IMAGEPATH . 'logo.png'); ?>

How would I go about adding the alt attribute - "my awesome alt" - to this image using PHP so that when I go into view source I see something like this for the image?

    <img src="http://examplesite.com/img/logo.png" alt="my awesome alt"/>

I am using codeigniter.

</div>
<?php echo img(array('src'=>'image/picture.jpg', 'alt'=> 'alt information')); ?>

Try like

<?php echo img(IMAGEPATH . 'logo.png',array('alt'=> 'alt information')); ?>