(.*)<\/a>/';
$item_desc = '/(.*)<\/div>/';
$item_price = '/
(.*)<\/td>/';
if ($this->request->hasFiles() == true) {
//Print the real file names and their sizes
foreach ($this->request->getUploadedFiles() as $file) {
//Move the file into the application
$route = STORAGE_PATH . 'temp/' . $file->getName();
$file->moveTo($route);
}
$this->exelphp->addFile($route);
$result = $this->exelphp->getRows();
}
foreach($result as $row){
$proxy = \proxy::getInstance();
$page = $this->parseExistLink('price.aspx?sr=-4&pcode='.$row[1],$proxy->getProxy());
$check_items = preg_match($item_reg, $page, $check);
if($check_items){
preg_match_all($items_reg, $page, $one_item);
$items[] = $one_item;
} else {
preg_match_all($link_reg, $page, $links);
$items = array();
foreach($links[1] as $link){
$page = $this->parseExistLink($link,$proxy->getProxy());
preg_match_all($items_reg, $page, $one_item);
$items[] = $one_item;
}
}
die(print_r($items));
if(!empty($items)){
$num = count($items);
for($i=0; $i<$num; $i++){
/*$sub_num = count($items[$i][1]);
for($x=0; $x<$sub_num; $x++){
$final_list[$i][$x] = preg_split('/\|+/', preg_replace('/<(.*?)>/', '|', $items[$i][0][$x]));
}*/
preg_match_all( $item_name, $items[$i][0][0], $name);
//$final_list[] = $name;
}
} else {
die('по запросу ничего не найдено');
}
// Array
// (
// [0] => Array
// (
// [0] => Array
// (
// [0] => | • Запрошенный артикул |