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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:55:14+00:00 2026-06-10T06:55:14+00:00

I know My question seems Like duplicated( duplicate )… But exceptionally I’m not trying

  • 0

I know My question seems Like duplicated(duplicate)…
But exceptionally I’m not trying to parse a “True/Valid” HTML, its a part of javascript variables / or of HTML tags, see my example:

                <td width="10"></td>
            <td ><div id="combo_rub" style="CURSOR:pointer"></div><input type="hidden" id="rech_cod_cat"  name="rech_cod_cat" value="1"/></td>
            <td ><div id="combo_typ" style="CURSOR:pointer"></div></td>
            <td ><div id="combo_sou_typ" style="CURSOR:pointer"></div></td>

            <script type="text/javascript">
            d_rech_cod_rub       = "101";
            d_rech_cod_typ       = "1";
            d_rech_cod_sou_typ   = "1020121";

            //ComboBox sous_type
            var z_sou_typ=new dhtmlXCombo("combo_sou_typ","rech_cod_sou_typ",160);

So what i want in my code PHP is to retrieve the value of(d_rech_cod_rub, d_rech_cod_typ, d_rech_cod_sou_typ) from Javascript part, not from HTML as you can see…

the second scenario is:

<td><a href="AnnoncesImmobilier.asp?rech_cod_rub=101&amp;rech_cod_typ=1">
<font color="#2154eb">Location (6920)</font></a> </td></tr></table></td></tr>
<tr><td><table width="100%" cellpadding="0" cellspacing="0"><tr>   
<td><a href="AnnoncesImmobilier.asp?rech_cod_rub=101&amp;rech_cod_typ=5"></td>      

Same here i need to retrieve the ‘101’ value…

Finally, The full story: I’m using very frequently the Curl extension of PHP then I come across with a content like the above examples… the problem is when i use a HTML-Parser like (http://simplehtmldom.sourceforge.net/) i can not done my work with this, because it work only with a valid HTML..:(
my question: there is any solution to retrieve the values in a stable manner ?
what are you doing if you come across a case like me ?

Thanks guys.

EDIT : So according to most answers, using RegX do the trick…

  • 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-10T06:55:16+00:00Added an answer on June 10, 2026 at 6:55 am

    The following regexes do the trick

    d_rech_cod_[a-z_ ]*= "([0-9]*)";
    rech_cod_rub=([0-9]*)
    

    Not sure about PHP but you might be able to evaluate it using the following code:

    preg_match($regex, $content, $matches);
    print($matches[1]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I know this seems like a duplicate question, but don't think it is.
I know the question title seems like a duplicate, but I've been unable to
I know this seems like a repeat question, but i've read all the others
I googled my question but it seems like I don't know what's it called
I know this may seem like a math question but i just saw this
Now this may seem like a silly question, but I need to know how
It seems to be really stupid question, I know. But anyway. Lats say, I
This question might not seem very technical but, out of curiosity,I want to know
I know this might seem a controversial question but it really is not meant
I know that that question may be seemed as a duplicate, but I haven't

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.