Example #1
0
    if (count($cells) >= 3) {
        $value = $cells[0]->innertext;
        // EUR, CHF etc
        $value = strip_tags(trim($value));
        $codeAtr1 = GetCodeSize($value);
        $txt = writeSql($name[1], $codeAtr1, $imageArr[0], $catName, $pageNameRec1);
        $value1 = $cells[1]->innertext;
        // USD 0.599 etc
        $value1 = strip_tags(trim($value1));
        $codeAtr2 = GetCodeSize($value1);
        $txt1 = writeSql($name[1], $codeAtr2, $imageArr[1], $catName, $pageNameRec1);
        $value2 = $cells[2]->innertext;
        // USD 0.599 etc
        $value2 = strip_tags(trim($value2));
        $codeAtr3 = GetCodeSize($value2);
        $txt2 = writeSql($name[1], $codeAtr3, $imageArr[2], $catName, $pageNameRec1);
    }
}
function GetCodeSize($value)
{
    $value = str_replace(" ", "", $value);
    $value = str_replace(""", "", $value);
    $value = explode("::", $value);
    $code1 = explode("Price", $value[1]);
    $price1 = explode("Length", $value[2]);
    $size = $value[3];
    $code = $code1[0];
    $price = $price1[0];
    $cost = $price / 1.3;
    return $code . "/" . $price . "/" . $size;
}
Example #2
0
    if (count($cells) >= 3) {
        $value = $cells[0]->innertext;
        // EUR, CHF etc
        $value = strip_tags(trim($value));
        $codeAtr1 = GetCodeSize($value);
        $txt = writeSql($name[1], $codeAtr1, $imageArr[0], $name[0]);
        $value1 = $cells[1]->innertext;
        // USD 0.599 etc
        $value1 = strip_tags(trim($value1));
        $codeAtr2 = GetCodeSize($value1);
        $txt1 = writeSql($name[1], $codeAtr2, $imageArr[1], $name[0]);
        $value2 = $cells[2]->innertext;
        // USD 0.599 etc
        $value2 = strip_tags(trim($value2));
        $codeAtr3 = GetCodeSize($value2);
        $txt2 = writeSql($name[1], $codeAtr3, $imageArr[2], $name[0]);
    }
}
function GetCodeSize($value)
{
    $value = str_replace(" ", "", $value);
    $value = explode("::", $value);
    $code1 = explode("Price", $value[1]);
    $price1 = explode("Length", $value[2]);
    $size = $value[3];
    $code = $code1[0];
    $price = $price1[0];
    //echo $code."/".$price."/".$size;
    return $code . "/" . $price . "/" . $size;
}
function writeSql($name, $codeAtr1, $imageArr, $catName)