render array with images I have this array in PHP

$link = array(
    '#type'    =&gt; 'link',
    '#title'   =&gt; 'link1',
    '#href'    =&gt; 'http://www.link1.example',
    '#suffix'  =&gt; '&lt;br /&gt;',
  );


when i call the render() functions i get the correct html

&lt;a href="http://www.link1.example"&gt;link1&lt;/a&gt;


How i can change the above render array in order to include an image as a link?

In other words i want this as output from the render() function

&lt;a href="http://www.link1.example"&gt;&lt;img src='images/link1img.png' /&gt;&lt;/a&gt;


I have tried to use the theme('image',$array) function but when the result of theme() is passed to the render() i don't see the image to my page but the actual html code.
The pre-render function for a 'link' element type is drupal_pre_render_link()...looking at the docs, you can pass these parameters:


#title: The link text to pass as argument to l().
#href: The URL path component to pass as argument to l().
#options: (optional) An array of options to pass to l().


You can force a link prepared through l() to display HTML by passing 'html' =&gt; TRUE as an option, so you should be able to do the same through the render array:

$image = theme('image', array('path' =&gt; 'images/link1img.png'));

$link = array(
  '#type'    =&gt; 'link',
  '#title'   =&gt; $image,
  '#href'    =&gt; 'http://www.link1.example',
  '#options' =&gt; array('html' =&gt; TRUE, 'title' =&gt; 'link1'),
  '#suffix'  =&gt; '&lt;br /&gt;',
);