troubleshooting Question

Accessing specific element - DOM PHP HTML

Avatar of weekapaug
weekapaug asked on
HTMLPHP* DOM
8 Comments1 Solution141 ViewsLast Modified:
I am using the simple html DOM with PHP 7.0.

If i need to get at the pClassLarge value but set variable for each one, how would I do this??

<div class="outerClass"><p class="pClassTop">Subject One</p><p class="pClassLarge">I need this!!</p></div>
<div class="outerClass"><p class="pClassTop">Subject Two</p><p class="pClassLarge">I also need this value!!</p></div>
<div class="outerClass"><p class="pClassTop">Subject Three</p><p class="pClassLarge">And lastly this one too!!</p></div>

This code below is totally wrong, but I'm trying to express my intentions... Each pClassTop is  a different header and each pClassLarge within is a different value but I need to be sure I am isolating them.

$var1=(the value for pClassLarge within the pClass top IF <p>Subject One</p>);
$var2=(the value for pClassLarge within the pClass top IF <p>Subject Two</p>);
$var3=(the value for pClassLarge within the pClass top IF <p>Subject Three</p>);

Please excuse the rough code for the variables, as I have no idea where to begin, so I'm just trying to show the concept for now.  I am able to isolate by class, but then I'm just left with a bunch of digits that I have no idea what they belong to, so I need to set the variables for pClassLarge based on the subject contained within the pClassTop.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros