This is what I always use:
$url="https://somedomain.com/somesite/";
$content = file_get_contents($url);
$first_step = explode( '<div id="thediv">' , $content );
$second_step = explode("</div>" , $first_step[1] );
echo $second_step[0];
More Related Contents:
- Disable warnings when loading non-well-formed HTML by DomDocument (PHP)
- How to insert HTML to PHP DOMNode?
- Parse HTML with PHP’s HTML DOMDocument
- PHP DOMDocument errors/warnings on html5-tags
- Convert clickable anchor tags to plain text in html document
- loadHTML LIBXML_HTML_NOIMPLIED on an html fragment generates incorrect tags
- DOMDocument::loadHTML error
- Parse error: syntax error, unexpected T_STRING in C:\wamp\www\b_php\project\login_save.php on line 14 [closed]
- how to make css work with php? [closed]
- Array to string conversion in php check my code
- Pagination data
- Grabbing the href attribute of an A element
- How to extract img src, title and alt from html using php? [duplicate]
- How to get multiple selected values of select box in php?
- How to solve PHP error ‘Notice: Array to string conversion in…’
- Set up the base url in codeigniter
- Preserve Line Breaks From TextArea
- How to call a PHP function on the click of a button
- How do you parse and process HTML/XML in PHP?
- Can HTML be embedded inside PHP “if” statement?
- How to embed YouTube videos in PHP?
- getting a checkbox array value from POST
- jquery using ajax to send data and save in php [duplicate]
- How to dynamically populate options on dropdown lists based on selection in another dropdown?
- What is the best practice to use when using PHP and HTML?
- Output text file with line breaks in PHP
- Scroll bar for Datalist in HTML5
- Browser displays � instead of ´
- Convert HTML to Image in PHP without shell
- Why are escape characters being added to the value of the hidden input