Jump to content

Search the Community

Showing results for tags 'html parse'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Trying to parse some html but having trouble getting it into "groups". I am able to parse the html below into single elements with the following code. The html shown is only one group of information being parsed and is grouped by based on the data-channelid. Following this group starts a new section with a different data-channelid followed by same classes just with different values and iformation. How can it be parsed to have a result groupled by the data-channelid? As I show below, I can get each individual item by can't seem to put them together like: CHANNEL="1" SHOW="SHOW1" TIME="WHATEVERTIME" DESC="BLABLA" CHANNEL="1" SHOW="SHOW2" TIME="WHATEVERTIME" DESC="BLABLA" CHANNEL="1" SHOW="SHOW3" TIME="WHATEVERTIME" DESC="BLABLA" then once all elements related to CHANNEL="1", parse the next group based on its channelid. foreach ($aclasses as $aclass){ $cid[]=$aclass->getAttribute('data-channelid'); } foreach ($progcols as $progcol){ foreach ($names as $name){ $show[]=$name->nodeValue; } foreach ($times as $time){ $ptime[]=$time->nodeValue; } foreach ($descs as $desc){ $pdesc[]=$desc->nodeValue; } } //PROGRAMCOLS for($i=0; $i<count($show); $i++){ echo "CHANNEL. . . . . ".$cid[$i]."<br>"; echo "SHOW. . . . . ".$show[$i]."<br>"; echo "TIME. . . . . ".$ptime[$i]."<br>"; echo "DESC. . . . . ".$pdesc[$i]."<br>"; } <div class="col th"> <a class="channel_sched_link" href="javascript:void(0)" title="TITLE1" data-channelid="1"> <img src="/XXXXX" width="30" height="20" alt="AA" />AA </a> </div> <div class="prog_cols"> <div class="col ts ts_1 prog_1045493 ps_0" data-catid="" > <span class="name">SHOW1</span> <div class="time">August 5, 2015, 11:00 am - 1:00 pm</div> <div class="desc">Information here.<br/> </div> </div> <div class="col ts ts_2 prog_1045494 ps_1" data-catid="" > <span class="name">SHOW2</span> <div class="time">August 5, 2015, 1:00 pm - 2:00 pm</div> <div class="desc">Information here.<br/> </div> </div> <div class="col ts ts_1 prog_1045495 ps_3" data-catid="" > <span class="name">SHOW3</span> <div class="time">August 5, 2015, 2:00 pm - 4:00 pm</div> <div class="desc">Information here.<br/> </div> </div> </div>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.