当前位置: 首页>>代码示例>>PHP>>正文


PHP url2html函数代码示例

本文整理汇总了PHP中url2html函数的典型用法代码示例。如果您正苦于以下问题:PHP url2html函数的具体用法?PHP url2html怎么用?PHP url2html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了url2html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: temp_txbb

 public function temp_txbb($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //标题
     $title = $html->find('div[class=ptd-title]', 0)->plaintext;
     $data['title'] = trim($title);
     //招聘人数
     $zp_num = $html->find('table[class=ptd-item] tbody tr td', 1)->plaintext;
     $data['zp_num'] = trim($zp_num);
     $work_dom = $html->find('table[class=ptd-item]', 1);
     // 工作日期
     $work_day = $work_dom->find('tbody tr td', 1)->plaintext;
     $data['work_day'] = trim($work_day);
     //工作地点
     $work_place = $work_dom->find('tbody tr', 2)->find('td', 1)->plaintext;
     $data['work_place'] = trim($work_place);
     //工作要求
     $work_content = $work_dom->find('tbody tr', 3)->find('td', 1)->plaintext;
     $data['work_content'] = trim($work_content);
     //联系电话
     $tel = $work_dom->find('tbody tr', 4)->find('td', 1)->plaintext;
     $data['tel'] = trim($tel);
     //报名截止时间
     $end_time = $work_dom->find('tbody tr', 5)->find('td', 1)->plaintext;
     $data['end_time'] = trim($end_time);
     var_dump($data);
 }
开发者ID:hani1990,项目名称:spider,代码行数:28,代码来源:Txbb.php

示例2: temp_zhaoshixi

 public function temp_zhaoshixi($url)
 {
     // header("Content-type: text/html; charset=gbk");
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=jobsshow]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=jobsshow]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=jobsshow] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('ul[class=floatli link_bku] li', 3)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('~', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('ul[class=floatli link_bku] li', 7)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('ul[class=floatli link_bku] li ', 1)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     // $welfare            =  $html->find( 'div[id=infoview] ul' , 0 )->plaintext;
     // $data['welfare']    =  $welfare;
     $trade = $html->find('div[class=floatli link_bku] li ', 8)->plaintext;
     $data['trade'] = $trade;
     //发布时间
     $pdate = $html->find('div[class=imgtipbox] div', 0)->plaintext;
     preg_match('/\\d*-\\d*-\\d*/', $pdate, $m);
     print_r($m);
     $ptime = strtotime($m[0]);
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['ptime'] = $ptime;
     $data['time'] = $ptime;
     $data['site_name'] = 'zhaoshixi';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:52,代码来源:Zhaoshixi.php

示例3: urls

 public function urls()
 {
     $url = 'http://weixin.sogou.com/';
     header("Content-Type:text/html;charset:utf-8");
     import(Org . Net . simple_html_dom);
     $html = url2html($url, $this->{$header});
     $hrefs = $html->find('a');
     //获取所有的链接
     foreach ($hrefs as $url) {
         $this->insert_urls($url->href);
     }
     $html->clear();
 }
开发者ID:hani1990,项目名称:phpspider,代码行数:13,代码来源:WeixinController.class.php

示例4: temp_zhaopin58

 public function temp_zhaopin58($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=posMsg borb]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=posMsg borb]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=headConLeft] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('div[class=xq] ul li div span strong', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('dd[class=job_request] span', 1)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('div[class=company] a ', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('div[id=infoview] ul', 0)->plaintext;
     $data['welfare'] = $welfare;
     $trade = $html->find('div[class=compMsg clearfix] ul li a', 0)->plaintext;
     $data['trade'] = $trade;
     //发布时间
     $pdate = $html->find('ul[class=headTag] li span strong', 0)->plaintext;
     preg_match('/\\d/', $pdate, $m);
     print_r($m);
     $ptime = strtotime("-{$m['0']} day");
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['ptime'] = $ptime;
     $data['time'] = $ptime;
     $data['site_name'] = 'zhaopin58';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:51,代码来源:Zhaopin58.php

示例5: temp_lagou

 public function temp_lagou($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('dd[class=job_bt]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('dd[class=job_bt]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=content_l content_l_jobdetail] dl dt h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('dd[class=job_request] span', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('dd[class=job_request] span', 1)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('dl[class=job_company] dt div h2', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('dd[class=job_request] span', 4)->plaintext;
     $data['welfare'] = $welfare;
     //发布时间
     $pdate = $html->find('dd[class=job_request] div', 0)->plaintext;
     preg_match('/\\d/', $pdate, $m);
     print_r($m);
     $ptime = strtotime("-{$m['0']} day");
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['ptime'] = $ptime;
     $data['time'] = $ptime;
     $data['site_name'] = 'lagou';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:49,代码来源:Lagou.php

示例6: temp_chinahr

 public function temp_chinahr($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=job_desc]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=job_desc]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=fl job_infoLeft] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //薪资
     $salary = $html->find('div[class=detail_C_info] span', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('div[class=job_desc] p', 0)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('span[class=subC_name] a', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('ul[class=welf_list clear toggleWelfL]', 0)->plaintext;
     $data['welfare'] = $welfare;
     //发布时间
     $pdate = $html->find('span[class=detail_C_Date fl]', 0)->plaintext;
     preg_match('/\\d*-\\d*-\\d*/', $pdate, $pdate_reg);
     $ptime = strtotime(trim($pdate_reg[0]));
     $data['ptime'] = $ptime;
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['site_name'] = 'chinahr';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 2;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:47,代码来源:Chinahr.php

示例7: temp_zhilian

 public function temp_zhilian($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=tab-inner-cont]', 0)->plaintext;
     $data['des'] = trim($des);
     $content = $html->find('div[class=tab-inner-cont]', 0)->innertext;
     $data['content'] = trim($content);
     //标题
     $title = $html->find('div[class=inner-left fl] h1', 0)->plaintext;
     $title = trim($title);
     $data['title'] = $title;
     //薪资
     $salary = $html->find('ul[class=terminal-ul clearfix] li strong', 0)->plaintext;
     $salary = trim($salary);
     $arra_salaray = explode('-', $salary);
     print_r($arra_salaray);
     preg_match('/\\d/', $arra_salaray[0], $min_salary);
     preg_match('/\\d/', $arra_salaray[1], $max_salary);
     $data['min_salary'] = $min_salary[0] * 1000;
     $data['max_salary'] = $max_salary[0] * 1000;
     $data['salary'] = trim($salary);
     //城市
     $city = $html->find('ul[class=terminal-ul clearfix] li strong a', 0)->plaintext;
     $data['city'] = trim($city);
     //公司
     $corp_name = $html->find('p[class=company-name-t]', 0)->plaintext;
     $data['corp_name'] = $corp_name;
     //福利
     $welfare = $html->find('div[class=welfare-tab-box]', 0)->plaintext;
     $data['welfare'] = $welfare;
     //发布时间
     $pdate = $html->find('ul[class=terminal-ul clearfix] li strong', 2)->plaintext;
     $ptime = strtotime(trim($pdate));
     $data['ptime'] = $ptime;
     $pdate = date('Y年m月d号', $ptime);
     $data['pdate'] = $pdate;
     $data['site_name'] = 'zhilian';
     //url
     $data['url'] = trim($url);
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:47,代码来源:Zhilian.php

示例8: temp_epub5

 public function temp_epub5($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=sintro]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $data['title'] = $html->find('div[class=sinfo] ul li ', 0)->plaintext;
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 9;
     $html->clear();
     //var_dump( $data );
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:18,代码来源:Epub5.php

示例9: temp_xuexi111

 public function temp_xuexi111($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=info-content]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $title = $html->find('table[id=download-table] tbody tr td', 0)->plaintext;
     $data['title'] = trim($title);
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:19,代码来源:Xuexi111.php

示例10: temp_book118

 public function temp_book118($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[id=mainSoftIntro]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $title = $html->find('div[class=downInfoTitle]', 0)->plaintext;
     $data['title'] = trim($title);
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:19,代码来源:Book118.php

示例11: temp_feng

 public function temp_feng($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     //内容
     $des = $html->find('div[class=t_fsz]', 0)->plaintext;
     $data['des'] = trim(msubstr($des, 0, 150));
     //标题
     $title = $html->find('div[class=pl_tit_panel] h1', 0)->plaintext;
     $data['title'] = trim($title);
     //url
     $data['url'] = trim($url);
     $data['time'] = time();
     $data['md5_url'] = md5($url);
     $data['type'] = 7;
     $html->clear();
     var_dump($data);
     return $data;
 }
开发者ID:hani1990,项目名称:spider,代码行数:19,代码来源:Feng.php

示例12: temp_chaoxing

 public function temp_chaoxing($url)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     if ($html) {
         //内容
         $des = $html->find('div[class=boxLeft]', 0)->plaintext;
         $des = trim($des);
         $data['des'] = trim(msubstr($des, 0, 150));
         //标题
         $title = $html->find('div[class=box_title] h1', 0)->plaintext;
         $data['title'] = trim($title);
         //url
         $data['url'] = trim($url);
         $data['time'] = time();
         $data['md5_url'] = md5($url);
         $data['type'] = 9;
         $html->clear();
         var_dump($data);
         return $data;
     } else {
         return 0;
     }
 }
开发者ID:hani1990,项目名称:spider,代码行数:24,代码来源:Chaoxing.php

示例13: HTML2FPDF

        $data[$field] = $row[$field];
    }
    $list[] = $data;
}
//HTML2FPDF contains the functions - headerPDF, footerPDF, createHeading, createTr
$pdf = new HTML2FPDF();
//these are some shortcut variables
$created_by = $current_user;
$created_by->retrieve($focus->created_by);
$dateModified = $focus->date_modified . "," . $app_strings["LBL_BY"] . "," . $created_by->user_name;
$modified_by = $current_user;
$modified_by->retrieve($focus->modified_user_id);
$dateEntered = $focus->date_entered . "," . $app_strings["LBL_BY"] . "," . $modified_by->user_name;
$periodic = $app_list_strings['clientrequest_samples_options'][$focus->periodic];
$samples = $app_list_strings['clientrequest_samples_options'][$focus->samples];
$description = nl2br(url2html($focus->description));
//begin the Body's html creation (the Header and Footer are called later)
$bodyHtml .= $pdf->sectionHeading($mod_strings["LBL_MODULE_NAME"], $focus->name, $focus->number);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_PRODUCT_INFORMATION"]);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_CODE"], $product->pnum, $mod_strings["LBL_ACCOUNT_NAME"], $product->account_name);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_NAME"], $product->name, $mod_strings["LBL_CONTACT_NAME"], $product->contact_name);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_REQUEST_INFORMATION"]);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_ASSIGNED_USER_ID"], $focus->assigned_user_name, $mod_strings["LBL_DUE_DATE"], $focus->due_date);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_DATE_ENTERED"], $dateEntered, $mod_strings["LBL_DATE_MODIFIED"], $dateModified);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_GENERAL"]);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_QUANTITY"], $focus->quantity, $mod_strings["LBL_PERIODIC"], $periodic);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_FILES"], $focus->files, $mod_strings["LBL_SAMPLES"], $samples);
$bodyHtml .= $pdf->createTr(false, $mod_strings["LBL_SPECIAL_REQUIREMENTS"], $focus->special_requirements, null, null, true);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_DESCRIPTION"], $description, null, null, true);
$bodyHtml .= $pdf->createHeading($mod_strings["LBL_OPERATIONS"]);
$bodyHtml .= $pdf->createTr(true, $mod_strings["LBL_OPERATIONS_DESCRIPTION"], $focus->operation_description, null, null, true);
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:CreatePDF.php

示例14: temp_amazon

 public function temp_amazon($url, $tag)
 {
     require_once APPPATH . 'libraries/simple_html_dom.class.php';
     $html = url2html($url, $this->header);
     if ($html) {
         $li = $html->find('li[class=s-result-item celwidget]');
         // var_dump($title);
         foreach ($li as $l) {
             $href = $l->find('a', 0)->href;
             $title = $l->find('div[class=a-fixed-left-grid-col a-col-right] a h2', 0)->plaintext;
             $author = $l->find('div[class=a-row a-spacing-none]', 0)->plaintext;
             $price = $l->find('span[class=a-size-base a-color-price s-price a-text-bold]', 0)->plaintext;
             $price = str_replace('¥', '', $price);
             echo $price . '<br>';
             echo $author . '<br>';
             echo $title . '<br>';
             $data['url'] = urldecode($href) . '&tag=zhaoshu114-23';
             $data['md5_url'] = md5($href);
             $data['title'] = mb_convert_encoding($title, 'UTF-8', 'HTML-ENTITIES');
             $data['author'] = $author;
             $data['price'] = $price;
             $data['from_site'] = 'amazon';
             $data['type'] = 3;
             $data['tag'] = $tag;
             $this->insert_db($data);
         }
         $html->clear();
     } else {
         return 0;
     }
 }
开发者ID:hani1990,项目名称:spider,代码行数:31,代码来源:Amazon.php

示例15: nl2br

    $xtpl->assign('disabled_quote', "disabled");
    $xtpl->assign('LBL_QUOTE_BUTTON_TITLE', $mod_strings['LBL_CLIENTORDER_NOT_CLIENTORDERD']);
} else {
    $xtpl->assign('disabled_quote', "");
    $xtpl->assign('LBL_QUOTE_BUTTON_TITLE', $mod_strings['LBL_CLIENTORDER_NOT_CLIENTORDERD']);
}
//$xtpl->assign('quote_action', 'quoted');
//$xtpl->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js().get_format_js() . $quicksearch_js);
//Assign DetailView Fileds
$xtpl->assign('name', $focus->name);
$xtpl->assign('account_name', $focus->account_name);
$xtpl->assign('account_id', $focus->account_id);
$xtpl->assign('contact_name', $focus->contact_name);
$xtpl->assign('contact_id', $focus->contact_id);
$xtpl->assign('assigned_user_name', $focus->assigned_user_name);
$xtpl->assign('description', nl2br(url2html($focus->description)));
$xtpl->assign('vision', $focus->vision);
$xtpl->assign('period', $app_list_strings['clientorders_period_options'][$focus->period]);
$xtpl->assign('number', $focus->number);
$xtpl->assign('category', $app_list_strings['clientorders_category_options'][$focus->category]);
$xtpl->assign('note', $focus->note);
$xtpl->assign('quantity', $focus->quantity);
$xtpl->assign('status', $app_list_strings['product_status'][$focus->get_status($focus->id)]);
if (!is_null($focus->product_id) && !empty($focus->product_id)) {
    $product = new Products();
    $product->retrieve($focus->product_id);
    $xtpl->assign("pnum", $product->pnum);
    $xtpl->assign("product_name", $product->name);
    $xtpl->assign("product_id", $product->id);
    $xtpl->assign("account_name", $product->account_name);
    $xtpl->assign("account_id", $product->account_id);
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:DetailView.php


注:本文中的url2html函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。