Last active
December 29, 2015 13:12
-
-
Save waelio/baf0d57c7428d1a918c8 to your computer and use it in GitHub Desktop.
Get the HREF(src) on an <img />
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the HREF value of an IMG | |
* | |
* @param $g_ava | |
* | |
* @return mixed | |
*/ | |
function get_avatar_link($g_ava){ | |
if (is_string($g_ava)){ | |
preg_match("/src='(.*?)'/i", $g_ava, $matches); | |
return $matches[1]; | |
} | |
else | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment