Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-05-05 11:06:42
Point:250 Replies:4 POST_ID:828498USER_ID:11059
Topic:
JavaScript;;PHP Scripting Language
In php, I will use curl to grab the remote site's web page.
$html=curl_exec($curl), but is it in html format. Is it
possible save it into only innerText without any tag like <html><div>
</div></html> by php other bulit-in function ??? Otherwise I need to do program to extract those tag text.
Please advise
Duncan
$html=curl_exec($curl), but is it in html format. Is it
possible save it into only innerText without any tag like <html><div>
</div></html> by php other bulit-in function ??? Otherwise I need to do program to extract those tag text.
Please advise
Duncan
if (!empty($get_string)) $url .= '?' . $get_string; $curl = curl_init(); // HEADERS AND OPTIONS APPEAR TO BE A FIREFOX BROWSER REFERRED BY GOOGLE $header[] = "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; $header[] = "Cache-Control: max-age=0"; $header[] = "Connection: keep-alive"; $header[] = "Keep-Alive: 300"; $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; $header[] = "Accept-Language: en-us,en;q=0.5"; $header[] = "Pragma: "; // BROWSERS USUALLY LEAVE BLANK // SET THE CURL OPTIONS - SEE http://php.net/manual/en/function.curl-setopt.php curl_setopt( $curl, CURLOPT_URL, $url ); curl_setopt( $curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6' ); curl_setopt( $curl, CURLOPT_HTTPHEADER, $header ); curl_setopt( $curl, CURLOPT_REFERER, 'http://www.google.com' ); curl_setopt( $curl, CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $curl, CURLOPT_AUTOREFERER, TRUE ); curl_setopt( $curl, CURLOPT_RETURNTRANSFER, TRUE ); // curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, TRUE ); curl_setopt( $curl, CURLOPT_TIMEOUT, $timeout ); // RUN THE CURL REQUEST AND GET THE RESULTS $htm = curl_exec($curl); 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:
Author: duncanb7 replied at 2024-05-05 12:24:03
Thanks for all of your fast reply
Assisted Solution
Expert: Ray Paseur replied at 2024-05-05 11:51:04
80 points EXCELLENT
It's probably strip_tags() but you may want to keep some of the tags, too. The man page tells how to do that.
http://us.php.net/manual/en/function.strip-tags.php
If that does not work please post a link to the page you want to read, and show us what you want to get out of that page. Thanks, ~Ray
http://us.php.net/manual/en/function.strip-tags.php
If that does not work please post a link to the page you want to read, and show us what you want to get out of that page. Thanks, ~Ray
Accepted Solution
Expert: eugenbv replied at 2024-05-05 11:40:11
150 points EXCELLENT
strip_tags($htm)
Assisted Solution
Expert: eugenbv replied at 2024-05-05 11:38:23
20 points EXCELLENT
Tried removing using Regex?