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 8734361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:49:38+00:00 2026-06-13T09:49:38+00:00

// I have make some change but preg_match function doesn’t work and echo Work.

  • 0

// I have make some change but preg_match function doesn’t work and echo Work. I can not understand what is wrong. I’m going crazy

public function crawl()
{
    $html = $this->getPageHTMLContent($this->getDomain().$this->entryPagePath);
    $categoryPageDom = $this->getHtmlDom($html); 

    echo $categoryPageDom->find('div#pagination a.gh', 1)->attr['href'];

    preg_match("/\?p=(.*)&q/", $categoryPageDom->find('div#pagination a.gh', 1)->attr['href'], $machtes);
    var_dump($machtes);
}


public function getPageHTMLContent($url){
    $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     $contents = curl_exec ($ch);
     curl_close ($ch);

     return $contents;
}
  • 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-13T09:49:38+00:00Added an answer on June 13, 2026 at 9:49 am

    The problem was related to URL When i make echo $categoryPageDom->find(‘div#pagination a.gh’, 1)->attr[‘href’]; I get something like this http://www.xxxx.de/xxxxxxxxxxxxxxx=iw&artikel=101&detail=mak on the Browser. But when I see the source code, it looks like this http://www.xxxx.de/xxxxxxxxxxxxxxx=iw&*amp;*artikel=101&*amp;*detail=mak The problem was amp; i have use str_replace to remove it. Curl works very well

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created some documents and managed to make some simple queries but I
I have a small app, where user can make some calculations and solve equations.
I have plotted a contour map but i need to make some improvements. This
I need to make a change but continue providing backwards-compatibility for some time, but
I have an excel file that I need to make some changes. I need
Welcome, I notice that Youtube make some changes into their website code. Anyone have
I have to make some mods to an existing (and working) magento site. So
For example I have make test # do other stuff 'make test' runs some
I have some data which i need to make some statistics. I need to
i have been programing in vc++ for sometime and i want to make some

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.