![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
kevin_007
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by kevin_007
-
-
I would personally suggest trying to do most of this using jQuery or simular. You could do:
$.(document).ready(function(){ $.each("h2").html("Title 1", function(){ $(this).html("Replaced Text"); }); });
However, I'm not overly good with jQuery so you may want to edit that to make it work properly.
Hope this helps.
DarkMantis
I don't want to use Jquery because the page is an online page which i find it easier to work with simple html dom library and i don't know JQuery too much. Is it possible to check the value of h2 using simple html dom library?
-
suppose a page has the following tags
<div class = "news"> <div class = "article"> <h2>title 1</h2> <div class = "content"> <p>content 1....</p> </div> </div> <div class = "article"> <h2>title 2</h2> <div class = "content"> <p>content 2....</p> </div> </div> </div>
is it possible to check, using simple html dom library, whether the value of <h2> is title 1 and then if it is echo it, or store it in a variable?
what i've been able to do up to now is:
<?php
include('simple_html_dom.php');
foreach($article->find('div[class=news]') as $news)
{
foreach ($news->find('div[class=article]') as $content)
{
foreach ($content->find('h2') as $heading)
{
echo $heading;
}
}
}
?>
this only echos all the h2
simple html dom library insert into db
in PHP Coding Help
Posted
Hello, can any1 show me how to insert the following in db
what i want to do is insert every link in the db, but this is not working. The output is ok but the insert doesnt work. Any help please??