How to get avatar url only

I have been digging around looking at elgg functions to try and work out how I can return the url of an avatar without the background image.

elgg_view_entity_icon returns

<img src="http://community.elgg.org/_graphics/spacer.gif" alt="JohnnyD" title="JohnnyD" class="" style="background: url(http://community.elgg.org/mod/profile/icondirect.php?lastcache=1375112460&amp;joindate=1308322600&amp;guid=736855&amp;size=large) no-repeat;"/>

but I just want to echo this bit

http://community.elgg.org/mod/profile/icondirect.php?lastcache=1375112460&amp;joindate=1308322600&amp;guid=736855&amp;size=large

Can anyone help me with this please?

 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking