Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kiekvienam siuntiniui atskiri keywordai

Parašė And2s· 2010 Bal. 20 10:04:53
#6

function keywords($string){
    $string = preg_replace("/Ą/","ą",$string);
    $string = preg_replace("/Č/","č",$string);
    $string = preg_replace("/Ę/","ę",$string);
    $string = preg_replace("/Ė/","ė",$string);
    $string = preg_replace("/Į/","į",$string);
    $string = preg_replace("/Š/","š",$string);
    $string = preg_replace("/Ų/","ų",$string);
    $string = preg_replace("/Ū/","ū",$string);
    $string = preg_replace("/Ž/","ž",$string);
   $string = preg_replace("`\[.*\]`U","",$string);
   $string = preg_replace('`&(amp;)?#?[a-z0-9]+;`i',',',$string);
   $string = htmlentities($string, ENT_COMPAT, 'utf-8');
   $string = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i","\\1", $string );
   $string = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , ",", $string);
   return strtolower(trim($string, ','));
}




Šitą funkciją įsidėk į maincore.php.
naudojimas: keywords(siuntinio pavadinimas).. :) pvz sakinį "Kurias WEB technologijas esate perpratę?
" suskaldys į keywordus: "kurias,web,technologijas,esate,perpratę" :)

Redagavo And2s· 2010 Bal. 20 10:04:12