Sorry just realised that my response was missing a line. $str=ereg_replace(“[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]”,”<a href=\”\\0\” rel=\”nofollow\”>\\0</a>”,$str) This is the one I use to put the no-follow link in.
Category Archives: PHP
How To Automatically Make URL Clickable on WordPress
There are a time we need to put some URL on our WordPress content and make this content clickable. We need to added the link manually or using WYSIWG menu. And this is real pain if we must do this each time we add URL. Did you know that, WordPress offering functions to make this …
Continue reading “How To Automatically Make URL Clickable on WordPress”
php wordbreak
This is a useful script for anybody who wishes to get the beginning of a string up to the word break before $num of characters. Usually the use of substr will break half way through a word and leave things looking a little untidy on your site. This little function allows you to set the …
Get All URLs From Page
Ever needed to get all the urls from a string or a web page? No? Well, here is a script that will do it anyway. Basically it works on grabbbing anything beginning with http, or https, up to the next double comma ” or a space. The results are then returned in an array where …
Preventing Multiple Submits
The problem of multiple form submissions is quite common in PHP. Many people use forms for database interactions and emailing etc, but when the form is submitted, the page can be refreshed and the POST data, or file uploads is POSTed once again. This tutorial brings an easy remedy to the issue with the use …
Model View Controller MVC
http://www.phpro.org/tutorials/Model-View-Controller-MVC.html http://php-html.net/tutorials/model-view-controller-in-php/ http://anantgarg.com/2009/03/13/write-your-own-php-mvc-framework-part-1/ http://www.sitepoint.com/forums/showthread.php?t=575427 http://www.henriquebarroso.com/how-to-create-a-simple-mvc-framework-in-php/ http://php-html.net/tutorials/model-view-controller-in-php/