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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:38:51+00:00 2026-06-15T16:38:51+00:00

i am fighting with this small php issue, i am trying to read the

  • 0

i am fighting with this small php issue, i am trying to read the url parts from a page.

php code is this:

preg_match_all('!<a href="Jobbörse-reader\/items\/(.*?)" title=".+">(.*?)</a>!',$content,$ergebnisse);

my problem is that preg_match_all() is returning 0 and if i var_dump the $ergebnisse, i am getting empty array like this:

array(3) { [0]=> array(0) { } [1]=> array(0) { } [2]=> array(0) { } }

the page code where i am reading from is this:

<a href="Jobbörse-reader/items/somelink.html" title="some text">NAME</a>

i need somelink.html and NAME, but obviously, it cannot match them, can someone help me please?

BTW: i am reading the content successfully.
thanks

  • 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-15T16:38:53+00:00Added an answer on June 15, 2026 at 4:38 pm

    I have tested your code

    <?php
    $content='<body>
    <a href="Jobbörse-reader/items/somelink.html" title="some text">NAME</a>
    </body>';
    echo preg_match_all('!<a href="Jobbörse-reader\/items\/(.*?)" title=".+">(.*?)</a>!',$content,$ergebnisse);
    echo "\n";
    var_dump($ergebnisse);
    

    And it totally works:

    $ php test.php 
    1
    array(3) {
      [0]=>
      array(1) {
        [0]=>
        string(73) "<a href="Jobbörse-reader/items/somelink.html" title="some text">NAME</a>"
      }
      [1]=>
      array(1) {
        [0]=>
        string(13) "somelink.html"
      }
      [2]=>
      array(1) {
        [0]=>
        string(4) "NAME"
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been fighting with this simple piece of code forever. I'm trying to use
I have been fighting with this for a bit now. I’m trying to convert
I have been fighting this issue for some time so today I started a
I'm running into an issue with Entity Framework code-first in MVC3. I'm hitting this
I have been fighting this issue for days now and about to beat my
I'm studying Windows 8 programming and I've been fighting with this issue for few
i have been fighting with this code for a few hours now.... Sample Node
I'm fighting with this nasty problem. I've developed a page template for my website
I've been fighting with this PHP-snippet for some hours and I can't figure it
I've been fighting this problem for many hours now and could really use 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.