Jump to content

vin_akleh

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by vin_akleh

  1. how can i do this? select * From table_name Where date = currentmonth when date is a double and i insert it like so date = date("U") so i want to select the month of date("U") for the current month
  2. i can match this pattern /<a href="\/How_I_Met_Your_Mother\/season-1\/episode-1\/search\?page=\d+".+\d+<\/a>/i but my priblem is that this pattern selects line by line into an array what i need it to do is that it selects every match in 1 single line and puts it in a array with different index. $html=<div class="pagination"><span class="disabled prev_page">« Previous</span> <span class="current">1</span> <a href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=2" rel="next">2</a> <a href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=3">3</a> <a href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=4">4</a> <a href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=2" class="next_page" rel="next">Next »</a></div> //*this is all in one line not multiple lines* //if this was in multiple lines i wouldn't have this problem preg_match_all('/<a href="\/How_I_Met_Your_Mother\/season-1\/episode-1\/search\?page=.*/', $html, $pages); preg_match_all('#<a.+href="/How_I_Met_Your_Mother/season-\d+/episode-\d+/search\?page=\d+.+?">[^<]+</a>#', $html, $pages); for ($i=0;$i<sizeof($pages[0]);$i++) { echo $pages[0][$i]; echo $pages[0][0]; echo $pages[0][1]; //////////////////////////////////////////this would give undefined index } any suggestions would be appreciated.
  3. sorry about the mistake i made above here is what i need: hi, i would like for this regexp preg_match_all('/<a href="\/How_I_Met_Your_Mother\/season-.+[^next]/', $html, $link, PREG_PATTERN_ORDER); to grab only somthing like this: <a href="/How_I_Met_Your_Mother/season-1/episode-1/links/5215143" data-track-action="ClickNonFeaturedLSRPLink" rel="nofollow">videobb.com</a> not this: <a href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=2" rel="next">2</a> or this: <a href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=2" class="next_page" rel="next">Next »</a> or this: <a href="/How_I_Met_Your_Mother/season-1/episode-1/search" class="dofollow">search</a> or this: <a href="/How_I_Met_Your_Mother/season-1/episode-1" class="donotfollow sr-blue">Season 1 Episode 1</a> but it is grabing them all! can you give me some pointers thanks
  4. hi, i would like for this regexp preg_match_all('/<a href="\/How_I_Met_Your_Mother\/season-.+[^next]/', $html, $link, PREG_PATTERN_ORDER); to grab only somthing like this: <a rel="nofollow" data-track-action="ClickNonFeaturedLSRPLink" href="/How_I_Met_Your_Mother/season-1/episode-1/links/5215143">videobb.com</a> not this: <a rel="next" href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=2">2</a> or this: <a rel="next" class="next_page" href="/How_I_Met_Your_Mother/season-1/episode-1/search?page=2">Next »</a> or this: <a class="dofollow" href="/How_I_Met_Your_Mother/season-1/episode-1/search">search</a> or this: <a class="donotfollow sr-blue" href="/How_I_Met_Your_Mother/season-1/episode-1">Season 1 Episode 1</a> but it is grabing them all! can you give me some pointers thanks
×
×
  • 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.