I need to parse the text out of an h3 element on an HTML page and save the text into a variable.
<h3 class="names-header">Names</h3>
I need the output:
Names
Saved into a variable like
$text = $output;
I've tried using DOMs, specifically this example but I've had no luck.
I've also tried to extract the data using JQuery, and submitting it as a post using Ajax on the same page. Then grabbing the post and saving it in PHP. This also didn't work, and it seems like there is a much quicker way to do this.
I've googled and tried for around 2 hours now and still can't figure out how to fix it. Any help/advice would be greatly appreciated right now. Thank you.