and like us on FB

This is the second of a few functions that will linkify text with PHP (see the first here). Based on WordPress’ make_clickable() function, this function will create hyperlinks from URLs, partial URLs (no schema), FTP addresses, and emails. If you would like to shorten a URL in addition to creating an active link, modify beliefmedia_create_short() (as provided in the previous function) as required.

Ensure you close the pre tag on line 23. It had to be removed to preserve page formatting. Download the code below to avoid errors.

Usage is as follows:

The function will return the following:

Fully constructed URL: http://www.beliefmedia.com/. Partial URL (no schema): http://www.flight.org/. Email: email marty@test.com.

Shortt URL for this post: http://shor.tt/E0c