/ Published in: PHP
In wordpress, if you want to auto convert all URLs in your string into clickable hyperlinks, you can actually do it using the built-in function make_clickable().
If you need to do that outside of wordpress, you can use the same function.
Example:
$string = 'I have some texts here and also links such as http://www.youtube.com , www.haha.com and [email protected]. They are ready to be replaced.';
echo make_clickable($string);
If you need to do that outside of wordpress, you can use the same function.
Example:
$string = 'I have some texts here and also links such as http://www.youtube.com , www.haha.com and [email protected]. They are ready to be replaced.';
echo make_clickable($string);
URL: http://zenverse.net/php-function-to-auto-convert-url-into-hyperlink/