function nofollow($content, $alanadiniz = null) {
return preg_replace_callback(
"#(]+?)>#is", function ($mach) use ($alanadiniz) {
return (
!($alanadiniz && strpos($mach[1], $alanadiniz) !== false) && strpos($mach[1], 'rel=') === false
) ? $mach[1] . ' rel="nofollow">' : $mach[0];
}, $content
);
}