How can I get the inner text of an HTML element using Simple HTML DOM parser?
-
I have html like <div class="cost_decoration"> <span class="msrp">$85</span> 40% off </div> My Question is ... How to get tex 40% off from above. When I try I am getting like "$85 40% off" but I want to get only term 40% off.
-
Answer:
$cost = $html->find(div[class="cost_decoration"], 0); if($cost->childNodes(0)->tag) { echo "do not echo"; } else { echo $cost->plaintext; }
Gian Carlo Dimaculangan at Quora Visit the source
Related Q & A:
- How can I communicate Raspberry Pi and Arduino (in both ways) using a 10-15m distance wires?Best solution by Arduino
- How can I put pictures into my e-mail instead of using attachments?Best solution by Yahoo! Answers
- How can I get the font size of text in elements within a webpage?Best solution by Stack Overflow
- How can I get cash on ebay by using a paypal?Best solution by Yahoo! Answers
- How can I get a text alert when I get an email?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.