Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9171093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:06:58+00:00 2026-06-17T16:06:58+00:00

I have an array of items like this: <tr> <td class=vertTh> <center> <a href=/browse/200

  • 0

I have an array of items like this:

<tr>
    <td class="vertTh">
        <center>
            <a href="/browse/200" title="More from this category">Video</a>
            <br />
            (
            <a href="/browse/201" title="More from this category">Movies</a>
            )
        </center>
    </td>
    <td>
        <div class="detName">
            <a href="/torrent/8036528/Life.of.Pi.2012.DVDSCR" class="detLink" title="Details for Life.of.Pi.2012.DVDSCR">Life.of.Pi.2012.DVDSCR</a>
        </div>
        <a href="magnet:?xt=urn:btih:b129c8fd1c91b00589ef8fe646f52ce10148a3c9&dn=Life.of.Pi.2012.DVDSCR&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80" title="Download this torrent using magnet">
            <img src="//static.thepiratebay.se/img/icon-magnet.gif" alt="Magnet link" />
        </a>
        <img src="//static.thepiratebay.se/img/icon_comment.gif" alt="This torrent has 68 comments." title="This torrent has 68 comments." />
        <img src="//static.thepiratebay.se/img/icon_image.gif" alt="This torrent has a cover image" title="This torrent has a cover image" />
        <a href="/user/scene4all">
            <img src="//static.thepiratebay.se/img/vip.gif" alt="VIP" title="VIP" style="width:11px;" border='0' />
        </a> <font class="detDesc">Uploaded 01-18&nbsp;17:41, Size 1.25&nbsp;GiB, ULed by
            <a class="detDesc" href="/user/scene4all/" title="Browse scene4all">scene4all</a></font> 
    </td>
    <td align="right">33981</td>
    <td align="right">18487</td>
</tr>

How to preg_match()/preg_match_all()

I tried using this pattern:

<tr>
    <td class="vertTh">
        (?P<cat>.*?)
    </td>
    <td>
        <div class="detName">
            (?P<name>.*?)
        </div>
        (?P<link>.*?)
    </td>
    <td align="right">(?P<up>.*?)</td>
    <td align="right">(?P<down>.*?)</td>
</tr>

And this code:

preg_match_all("#$pattern#s", $item, $v);
var_dump($v);

And it returns:

array(11) {
  [0]=>
  array(0) {
  }
  ["cat"]=>
  array(0) {
  }
  [1]=>
  array(0) {
  }
  ["name"]=>
  array(0) {
  }
      ...
}

Can someone help me, how to fix this code to return actual content?
I think it’s enough information I have provided.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:06:59+00:00Added an answer on June 17, 2026 at 4:06 pm

    I would do it in four steps instead of one:

    <?php
        preg_match_all('|category">([^<]*)</a>|isU', $html, $categories);
        preg_match('|<div class="detName">[^<]*<[^>]*>([^<]*)</a>|isU', $html, $name);
        preg_match('|<a href="(magnet:[^"]*)"|isU', $html, $link);
        preg_match_all('|<td align="right">([0-9]+)</td>|isU', $html, $up_down);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that looks like this: public class Items { String uselessText;
Okay, I have an array in my Main Class that looks like this: objectArray:Array
I have a struct like this: class Items { private: struct item { unsigned
I have an array of 50 items and I would like to choose 5
I have an array with lots of items with same names like CloudObserverCMSStub edited
I have an array (items) of custom class objects (catalogItem) each catalogItem has various
I have a set of classes something like this: abstract class CollectionAbs implements Iterator
In my program I have an array list of type Program like this: List<Program>
i have a class which looks like this public class Process_Items { String Process_Name;
I am copying a mutable array like this: //copy players' info into playerList from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.