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

  • Home
  • SEARCH
  • 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 6347785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:17:21+00:00 2026-05-24T21:17:21+00:00

source code: <div id=point>9</div> <div id=point>REAL POINT: 9</div> and parser code: $point = $html->find(‘div[id=point]’);

  • 0

source code:

<div id="point">9</div>
<div id="point">REAL POINT: 9</div>

and parser code:

$point = $html->find('div[id=point]');

so, when you write $point[0] it will be first, and the other will be second.

But sometimes i need to make an algorithm like this: “find the divs with id point and must begin with REAL POINT: “

We can find

$point = $html->find('div[id=point]')->innertext=' REAL POINT:';

But that finds only divs include ‘ REAL POINT:’

But i have to find divs innertext begin ‘REAL POINT:’

How can i find?

  • 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-05-24T21:17:23+00:00Added an answer on May 24, 2026 at 9:17 pm

    You could use stripos for case sensitive.

    foreach($html->find('div[id=point]') as $element) {
        if ( strpos($element->innertext, 'REAL POINT:') !== FALSE ) {
            // something here
        }
    }
    

    You could also do a search for the string exactly at the start:

    foreach($html->find('div[id=point]') as $element) {
        if ( strpos($element->innertext, 'REAL POINT:') === 0 ) {
            // something here
        }
    }
    

    But if you want to remove whitespace before the first character in a div:

    foreach($html->find('div[id=point]') as $element) {
        if ( strpos(trim($element->innertext), 'REAL POINT:') === 0 ) {
            // something here
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My ajax (jquery) response (html) gives me a whole junk of html source code
HTML view source code is: <IMG style=DISPLAY: inline src=https://admit.belgacom.be/WCE/ESW/img/load.gif /> but When i login
The code here does not return what one expects: jQuery('<div>Look here: [ jQuery0=null ]</div>').html()
I am using jQuery 1.4.4. and I have this source code: <div id=area1> <ul
I have the below (simplified) code, which uses the following source: <html> <p>line 1</p>
source code ... Thing is, if i specify required metadata using fluent modelmetadata provider
My source code needs to support both .NET version 1.1 and 2.0 ... how
Can source code examples be kept in a SQL database while retaining all formatting
Reading source code of sample projects, such as Beast and Bort, are recommended as
I installed the wxWidgets source code, compiled it and am linking the libraries thus

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.