Ask you the big God after the revision of the 46-level total score how to use regular expressions to get (old version of I will get)

Source: Internet
Author: User
This is level 46 website
 
  
  
Name: Zhao Yang
School: Changchun University of Traditional Chinese Medicine
Exam Category: English level Four
Ticket Number: 220090132112529
Test time: December 2013
Score: 0
hearing:000
reads:000
writing and translation:000

This is my code.
$a = curl_exec ($ch); $match = "# (. *) #";//$match = "#(. *)#";p reg_match_all ($match, $a, $b); $yourname = $b [1][0];$ School= $b [1][1]; $cet = $b ["]; $c = $b [1][5];//score $score=strip_tags ($c); $score =str_replace (" "," ", $score);  Return Array (' school ' = $school, ' name ' = = $yourname, ' cet ' + $cet, ' score ' = $score);

All the rest can get to the total score where they can't get it.


Reply to discussion (solution)

$a =<<< TXT
 
  tr> 
   
name: /th> Zhao Yang
School: Changchun University of Traditional Chinese medicine
Exam Category: English level four
Ticket Number: 220 090132112529
exam time: December 2013
score: 0
hearing:
read:
Writing and translation:
TXT; $match = "# (.*?) #is ";p reg_match_all ($match, $a, $b); $b [1][11] = preg_replace ('/\s/', '", Strip_tags ($b [1][11]));p Rint_r ($b [1]);
Array
(
[0] = + Name:
[1] = Zhao Yang
[2] = = School:
[3] = Changchun University of Traditional Chinese Medicine
[4] = Test Category:
[5] = English level Four
[6] = = Ticket No.:
[7] = 220090132112529
[8] = Test time:
[9] = December 2013
[Ten] = Total score:
[One] + 0 hearing: 000 reading: 000 Writing and translating: 000
)

$a =<<< TXT 
 
  tr> 
   
name: /th> Zhao Yang
School: Changchun University of Traditional Chinese medicine
Exam Category: English level four
Ticket Number: 220 090132112529
exam time: December 2013
score: 0
hearing:
read:
Writing and translation:
TXT; $match = "# (.*?) #is ";p reg_match_all ($match, $a, $b); $b [1][11] = preg_replace ('/\s/', '", Strip_tags ($b [1][11]));p Rint_r ($b [1]);
Array
(
[0] = + Name:
[1] = Zhao Yang
[2] = = School:
[3] = Changchun University of Traditional Chinese Medicine
[4] = Test Category:
[5] = English level Four
[6] = = Ticket No.:
[7] = 220090132112529
[8] = Test time:
[9] = December 2013
[Ten] = Total score:
[One] + 0 hearing: 000 reading: 000 Writing and translating: 000
)


But the contents of $ A should be changed.

The content is changed and the format is fixed
Otherwise, it doesn't matter "collection."

The content is changed and the format is fixed
Otherwise, it doesn't matter "collection."


Now there's a problem. Last line?> error
I'm taking you this
$match = "# (.*?) #is ";
Escaped or an error.
  • 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.