The question about regular expressions, thank you very much!

Source: Internet
Author: User
The following is the crawl to the page, want to pass the regular expression function to take out the inside of the teacher timetable arrangement information, I hope you heroes to help, thank you.
http/1.1 OK
Connection:close
Date:thu, 07:44:28 GMT
Server:yxlinkwaf
X-powered-by:asp.net
x-aspnet-version:1.1.4322
Cache-control:private
content-type:text/html; charset=gb2312
content-length:11062





<title>Modern Teaching Management Information system</title>
















Viewastext>





Reply to discussion (solution)

There is a lot of information, please give a desired result data format

It's best to post the original link and then tell the desired format

For example, the results obtained from the above information are: can be removed: Monday, linear algebra b,1-17 (3,4), Wang Li, Audio-visual building 205, ITCSC 14 (1); Thursday, linear algebra b,1-17 (3,4), Wang Li, Audio-visual building 205, ITCSC 14 (1)

Include ' simple_html_dom.php ';//This you can download a $dom=new simple_html_dom () on the Internet;//To convert the content to Utf-8 to handle $dom->load ($content); $names = $dom->find (' select[id=js] '); $res =array (); $res [' Name ']= $names [0]->find (' option[selected=selected] ' ) [0]->text (); $tabletr = $dom->find (' table[id=table6] tr '), foreach ($tabletr as $k = $tr) {foreach ($tr Find (' TD ') as $k 1=> $td) {if ($k 1!==0) {$info [$k] [$k 1]= $td->text ();}}} Optimize the data foreach ($info as $k + = $v) {if ($k ==1) {unset ($info [1]);} if (count ($v) ==8) {unset ($v [1]);} $info [$k]=array_values ($v);} $week = $info [0];unset ($info [0]);//Organization Data foreach ($info as $v) {foreach ($v as $k + = $v) {$tmp [$week [$k]][]= $v;}} $res [' Info ']= $tmp, Echo '
";p Rint_r ($res); echo"
/*array ([name] = Wang Feng [info] = = Array ([Monday] = = Array ( [0] = [1] = [2] = = Linear algebra b1-17 (3,4) Wang Li Audio-Visual Building 205 Division 14 (1) [3] = [4] = [5] = [6] = = [7] = [8] = [9] = = [ten] = = ) [Tuesday] = = Array ([0] = [1] = = [2] = [3] = [4] = [5] = = [6] = [7] = [8] = [9] = = [Wednesday] = = Array ([0] = = [1]= [2] = [3] = [4] = = [5 ] = [6] = [7] = [8] = = [9] = = [ten] = [Thursday] = = Array ( [0] = [1] = [2] = = Linear algebra b1-17 (3,4) Wang Li Audio-Visual Building 205 Division 14 (1) [3] = [4] = [5] = [6] = = [7] = [8] = [9] = = [ten] = = ) [Friday] = = Array ([0] = [1] = = [2] = [3] = [4] = [5] = = [6] = = [7] = [8] = [9] = [Ten] =&G T ) [Saturday] = = Array ([0] = [1] = = [2] = [3] = [4] = [5] = = [6] = [7] = [8] = [9] = = ) [Sunday] = = Array ([0] = [1] = = [2] = [3] = [4] = [5] = = [6] = [7] = [8] = [9] = = )) *///The course information according to your own needs $txt = <<
 ";p Rint_r ($arr); echo"
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.