הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   בעיה עם ביטויים רגולריים... :( (https://hosts.co.il/forums/showthread.php?t=53346)

daMn 06-09-07 23:22

ציטוט:

נכתב במקור על ידי Elad-A (פרסם 553066)
מספיק לך המשחקים והתאריך?

כן המשחקים ותאריך מספיק לי, אח"כ אני ינסה לקחת בעצמי את התוצאות של ההימורים(X,1,2) במקום שהזכרתי למעלה.

Elad-A 06-09-07 23:33

עשיתי משהו בכלל לא יעיל (לפי דעתי אפשר לשפר), אבל עובד טוב.

PHP קוד:

<?php
$site 
file_get_contents('http://www.toto.org.il/85_zimzumim.asp');
preg_match_all("/<td nowrap colspan=4 style='height:20px'><b>(.*?)<\/b><\/td>/si" $site $arr);
$title $arr[1][0];

preg_match_all("/<td align=right style='font-size:10px;color:#000000'>(.*?)&nbsp;<\/td>/si" $site $arr2);

preg_match_all("/<a class=teamslink style='font-weight:normal' href=javascript:showStat(.*?)>(.*?)<\/a><\/td>/si" $site $arr3);

$html "
<div style = \"text-align: center\">$title</div> <br />
<table border = \"1\" cellpading = \"0\" cellspacing = \"0\" width = \"80%\" dir = \"rtl\">
<tr>
    <td>המשחק</td>
    <td>תאריך</td>
</tr>
"
;

$total sizeof($arr3[2]);

for(
$i 0$i $total; ++$i)
{
$html .= "
<tr>
    <td>{$arr3[2][$i]}</td>
    <td>{$arr2[1][$i]}</td>
</tr>
"
;
}
$html .= "</table>";

echo 
$html;
?>

תהנה..

daMn 06-09-07 23:38

ציטוט:

נכתב במקור על ידי Elad-A (פרסם 553071)
עשיתי משהו בכלל לא יעיל (לפי דעתי אפשר לשפר), אבל עובד טוב.

PHP קוד:

<?php
$site 
file_get_contents('http://www.toto.org.il/85_zimzumim.asp');
preg_match_all("/<td nowrap colspan=4 style='height:20px'><b>(.*?)<\/b><\/td>/si" $site $arr);
$title $arr[1][0];

preg_match_all("/<td align=right style='font-size:10px;color:#000000'>(.*?)&nbsp;<\/td>/si" $site $arr2);

preg_match_all("/<a class=teamslink style='font-weight:normal' href=javascript:showStat(.*?)>(.*?)<\/a><\/td>/si" $site $arr3);

$html "
<div style = \"text-align: center\">$title</div> <br />
<table border = \"1\" cellpading = \"0\" cellspacing = \"0\" width = \"80%\" dir = \"rtl\">
<tr>
    <td>המשחק</td>
    <td>תאריך</td>
</tr>
"
;

$total sizeof($arr3[2]);

for(
$i 0$i $total; ++$i)
{
$html .= "
<tr>
    <td>{$arr3[2][$i]}</td>
    <td>{$arr2[1][$i]}</td>
</tr>
"
;
}
$html .= "</table>";

echo 
$html;
?>

תהנה..

אני מעריך מאוד את ההשקעה באמת תודה, אני יסתדר מפה.
אני ישפר קצת את היעילות ואת הקוד.

שוב תודה ולילה טוב.


כל הזמנים הם GMT +2. הזמן כעת הוא 19:46.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ