#!/usr/bin/perl -w
$zmienna = "mapa,";
$temp = substr($zmienna, 0, length($zmienna)-1);
print "Polska $temp";
11 mar 2010
#!/usr/bin/perl -w
$zmienna = "mapa,";
$temp = substr($zmienna, 0, length($zmienna)-1);
print "Polska $temp";
var idx = 0; var idx1 = 0; var idx2 = 0; var cnt = 0;
var city = '';
var url = window.location.href;
idx1=url.lastIndexOf("/");
idx2=url.indexOf("?", idx1);
city = url.substr(idx1, idx2-idx1);
for(i=0; i if(city.charAt(i)=='-') cnt++;
}
Funkcja zwraca wartość parametru q:
function q_in_url(url) {
var idx = 0;
var q = '';
idx = url.indexOf('q=');
if(idx!=-1) {
q = url.substr(idx+2, url.length);
if(q!='') {
return q;
}
}
return '';
};
Uruchomienie
var url = window.location.href;
var q = q_in_url(url)
$description = iconv("UTF-8","ISO-8859-2", $description);
$description = substr($description,0, 450);
$pos_cut = strrpos($description, ' ');
$description = substr($description, 0, $pos_cut);
$description = wordwrap($description, 55, "<br />");
przycięcie stringa do określonej długości, bez ucinania wyrazu
$html_keywords = $strona_fragment;
$html_description = substr(str_replace(' ', ' ',trim(strip_tags($strona_tresc))), 0, 250);