im bu sorunu yaşıyor ... ben sizin onu çözmek için nasıl herhangi bir fikirleri var acaba?
Ben Ders Adı, Öğretmen adını ve Sınıf ayırmak zorunda.
Progr.al.Janek ManderÕ 405 Arv.võr.Tom KülaotsÕ 205
Progr.al. is Lesson name, Janek Mander is Teacher name and Õ 405 is Classroom. Arv.võr. is Lesson name, Tom KÜlaots is Teacher name and Õ 205 is Classroom.
Ben bu yüzden muhtemelen diziye ... onları tanıyabilirsiniz onları ayırmak zorunda
info[0] = "Progr.al."
info[1] = "Janek Mander"
info[2] = "Õ 405"
Şimdi ben bu fikre sahip ... i büyük harf algılamak ve yerine bu dize ile ve # {uppercaseletter} sonra ben onlardan önce Õ 405 i bir her sınıfta olarak o tarafından patlayabilir ... Bir o has it patlayabilir eğer.
Peki Progrl.al.Janek ManderÕ 405 ... Orada üç büyük harfler ... sadece ve öğretmenler ilk isim her zaman ... benim Advatage için kullanabilirsiniz herhangi bir yolu yoktur ya da ben yeniden yazmak zorunda ikinci büyük harf var dom komut?
Tüm kod kadar ...
<!doctype html>
<html>
<head>
<title>Ilus tunniplaan</title>
<style>
.tund
{
width: 140px;
width: 405px;
border: 1px solid black;
}
.
</style>
</head>
<body>
<?php
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
function grab_page( $site )
{
$ch = curl_init( );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE );
curl_setopt( $ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );
curl_setopt( $ch, CURLOPT_TIMEOUT, 40 );
curl_setopt( $ch, CURLOPT_COOKIEFILE, "cookie.txt" );
curl_setopt( $ch, CURLOPT_URL, $site );
ob_start( );
return curl_exec ( $ch );
ob_end_clean( );
curl_close ( $ch );
}
$html = grab_page( "http://web.ametikool.ee/tunniplaan/11.%20n%e4dal%2008.11%20-%2013.11/" );
$dom = new domDocument;
/*** load the html into the object ***/
$dom->loadHTML($html);
/*** the table by its tag name ***/
$tables = $dom->getElementsByTagName('table');
/*** get all rows from the table ***/
$rows = $tables->item(0)->getElementsByTagName('tr');
/*** loop over the table rows ***/
foreach ($rows as $row)
{
$id = $id + 1;
if( $id > 16 )
{
/*** get each column by tag name ***/
$cols = $row->getElementsByTagName('td');
/*** echo the values ***/
for ( $counter = 0; $counter <= 9; $counter += 1)
{
$phrase = $cols->item($counter)->nodeValue;
echo $phrase . "<br/>\n";
}
}
}
?>
</body>
</html>