Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
Еми да.Примерно въвебдаш форумс.дата.бг и извеждаpaneznam каза:ам маи това <title>title</title>
и да вземе title в променлива така ли?
$fcontents = implode ('', file ("$HTTP_REFERER"));
$fcontents = stristr($fcontents, '<title>');
$rest = substr($fcontents, 7);
$extra = stristr($fcontents, '</title>');
$titlelen = strlen($rest) - strlen($extra);
$gettitle = trim(substr($rest, 0, $titlelen));
echo "Coming from: " . $gettitle . "<p>";
<?php
if ($_POST['submit'])
{
//Vzimame linka
$link = $_POST['address'];
// Vzimame Source koda
$source = file_get_contents($link);
// V $title[0] 6te e koda predi <title> a v $title[1] koda sled <title>
$title = explode("<title>", $source);
// Sega vzimame koda sled <title> i premahvame 4astta sled </title>
$title = explode("</title>", $title[1]);
// $title[0] e ve4e zaglavieto
echo '<h2>Zaglavie: '.$title[0]."</h2>";
}
else
{
?>
<form method="post" name="get_info">
<b>Link > </b><input type="text" name="address">
<input type="submit" name="submit">
</form>
<?php
}
?>
if(!isset($_GET['title'])) echo "window.location=\"?title=\"+title;\n";
StormBreaker каза:
human каза:$source = file_get_contents($_POST['video']);
$title = explode("<title>", $source);
$title = explode("</title>", $title[1]);
$title=str_replace(" / ZaZz","",$title[0]);
Мерси, но а се опитвам да взема title на клипе от youtube , но иска charset utf-8
http://it-bg.org/index.php?page=vbox7 Вижте
Можете ли да помогнете?
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php
if ($_POST['submit'])
{
//Vzimame linka
$link = $_POST['address'];
// Vzimame Source koda
$source = file_get_contents($link);
// V $title[0] 6te e koda predi <title> a v $title[1] koda sled <title>
$title = explode("<title>", $source);
// Sega vzimame koda sled <title> i premahvame 4astta sled </title>
$title = explode("</title>", $title[1]);
// $title[0] e ve4e zaglavieto
echo '<h2>Zaglavie: '.$title[0]."</h2>";
}
else
{
?>
<form method="post" name="get_info">
<b>Link > </b><input type="text" name="address">
<input type="submit" name="submit">
</form>
<?php
}
?>
admin каза:http://bg2.php.net/manual/en/function.strip-tags.php
ето.
Може да се избере какви тагове да не се махат.
Примерно би трябвало да стане така:
echo strip_tags($text, '<title>');
Ще махне всички тагове от стринга без <title>.
Ще му е по лесно .
<?php
function utf8_2_win1251 ($str_src)
{
$str_dst = "";
$i = 0;
while ($i<strlen($str_src))
{
$code_dst = 0;
$code_src1 = ord($str_src[$i]);
$i++;
if ($code_src1<=127)
{
$str_dst .= chr($code_src1);
continue;
}
else
if (($code_src1 & 0xE0) == 0xC0)
{
$code_src2 = ord($str_src[$i++]);
if (($code_src2 & 0xC0) != 0x80)
continue;
$code_dst = ( ($code_src1 & 0x1F) << 6) + ($code_src2 & 0x3F);
}
else
if (($code_src1 & 0xF0) == 0xE0)
{
$code_src2 = ord($str_src[$i++]);
if (($code_src2 & 0xC0) != 0x80)
continue;
$code_src3 = ord($str_src[$i++]);
if (($code_src3 & 0xC0) != 0x80)
continue;
$code_dst = ( ($code_src1 & 0x1F) << 12) + ( ($code_src2 & 0x3F) << 6) + ($code_src3 & 0x3F);
}
else
if (($code_src1 & 0xF8) == 0xF0)
{
$code_src2 = ord($str_src[$i++]);
if (($code_src2 & 0xC0) != 0x80)
continue;
$code_src3 = ord($str_src[$i++]);
if (($code_src3 & 0xC0) != 0x80)
continue;
$code_src4 = ord($str_src[$i++]);
if (($code_src4 & 0xC0) != 0x80)
continue;
$code_dst = ( ($code_src1 & 0x1F) << 18) + ( ($code_src2 & 0x3F) << 12) + ( ($code_src3 & 0x3F) << 6) + ($code_src4 & 0x3F);
}
else
{
continue;
}
if ($code_dst)
{
if ($code_dst==0x401)
{
$str_dst .= "�";
}
else
if ($code_dst==0x451)
{
$str_dst .= "�";
}
else
if ( ($code_dst>=0x410) && ($code_dst<=0x44F) )
{
$str_dst .= chr ($code_dst-848);
}
else
$str_dst .= "&#{$code_dst};";
}
}
return $str_dst;
}
if ($_POST['submit'])
{
//Vzimame linka
$link = $_POST['address'];
// Vzimame Source koda
$source = file_get_contents($link);
// V $title[0] 6te e koda predi <title> a v $title[1] koda sled <title>
$title = explode("<title>", $source);
// Sega vzimame koda sled <title> i premahvame 4astta sled </title>
$title = explode("</title>", $title[1]);
$title[0] = utf8_2_win1251($title[0]);
// $title[0] e ve4e zaglavieto
echo '<h2>Zaglavie: '.$title[0]."</h2>";
}
else
{
?>
<form method="post" name="get_info">
<b>Link > </b><input type="text" name="address">
<input type="submit" name="submit">
</form>
<?php
}
?>