Stormware Pohoda: Porovnání verzí
Z Wiki UnArt Slavičín
Skočit na navigaciSkočit na vyhledávání
| Řádek 15: | Řádek 15: | ||
$str=file_get_contents($argv, "r"); | $str=file_get_contents($argv, "r"); | ||
$last_table_start=strripos($str, "<table"); | $last_table_start=strripos($str, "<table"); | ||
$first_row_start=stripos($str, "<tr",$last_table_start+6); | $first_row_start=stripos($str, "<tr",$last_table_start+6); | ||
$second_row_start=stripos($str, "<tr",$first_row_start+3); | $second_row_start=stripos($str, "<tr",$first_row_start+3); | ||
Verze z 12. 3. 2009, 01:28
Import banky
Příprava HTML dat
Pokud máme HTML soubory s výpisy v několika (mnoha) souborech, musíme si z nich nejdříve udělat jeden velký soubor, a to například takto:
#!bin/bash rm vysledek.htm for i in $( ls *htm* ); do php -f radky.php $i >>vysledek.htm; done
Přičemž soubor radky.php bude obsahovat toto:
<?php
foreach ($_SERVER["argv"] as $argc=>$argv)
if ($argc>0 && file_exists($argv)) {
$str=file_get_contents($argv, "r");
$last_table_start=strripos($str, "<table");
$first_row_start=stripos($str, "<tr",$last_table_start+6);
$second_row_start=stripos($str, "<tr",$first_row_start+3);
$last_row_end=strripos($str, "</tr");
$str=substr($str, $second_row_start, $last_row_end+5-$second_row_start);
echo ($str);
}
?>