1
2
function nofollow($html, $skip = null) {
return preg_replace_callback(
Examples:
echo nofollow('<a href="link somewhere" rel="something">something</a>');
// will be same because it's already contains rel parameter
echo nofollow('<a href=" http://www.cnn.com">something</a>'); // ad
// add rel="nofollow" parameter to anchor
echo nofollow('<a href="http://localhost">something</a>', 'localhost');
// skip this link as internall link
echo nofollow('<a href="link somewhere" rel="something">something</a>');
// will be same because it's already contains rel parameter
echo nofollow('<a href=" http://www.cnn.com">something</a>'); // ad
// add rel="nofollow" parameter to anchor
echo nofollow('<a href="http://localhost">something</a>', 'localhost');
// skip this link as internall link
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.