[ create a new paste ] login | about

Link: http://codepad.org/IWYl7TGm    [ raw code | output | fork ]

shef - PHP, pasted on Aug 27:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

function myseo($t){
    $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    $a = array('kid', 'children');
    $uu = count($a);
    $theseotext = $t;
    for ($i = 0; $i < $uu; $i++) {
        $theseotext = str_replace($a[$i], '<a href="'.$url.'">'.$a[$i].'</a>', $theseotext);
    }
    return $theseotext;
}

var_dump(myseo('Some testing kid and children text'));

?>


Output:
1
string(78) "Some testing <a href="http://">kid</a> and <a href="http://">children</a> text"


Create a new paste based on this one


Comments: