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-04-26 08:05:39
Point:250 Replies:5 POST_ID:828486USER_ID:11059
Topic:
Hypertext Markup Language (HTML);;PHP Scripting Language
I would like to ask two question:
1-How to suppress the Warning such as "Warning: DOMDocument::loadHTMLFile() [domdocument.loadhtmlfile]: htmlParseEntityRef: expecting ';' in http://www..............on Line 20" since it is more than 100 for such warning.
I don't find any option from man php command in Linux for switch-off the warning message . Any solution ?
2- how to make s simple script to re-run the php command once it has fatal error , any informatiion for that ?
Please advise
Duncan
1-How to suppress the Warning such as "Warning: DOMDocument::loadHTMLFile() [domdocument.loadhtmlfile]: htmlParseEntityRef: expecting ';' in http://www..............on Line 20" since it is more than 100 for such warning.
I don't find any option from man php command in Linux for switch-off the warning message . Any solution ?
2- how to make s simple script to re-run the php command once it has fatal error , any informatiion for that ?
Please advise
Duncan
Author: duncanb7 replied at 2024-04-27 06:22:52
Thanks for your reply,
The second question might
go to new thread
The second question might
go to new thread
Accepted Solution
Expert: Rob Jurd replied at 2024-04-26 22:31:23
250 points EXCELLENT
see here in the manual. the "@" is used to suppress error and warning messages
http://au.php.net/manual/en/language.operators.errorcontrol.php
http://au.php.net/manual/en/language.operators.errorcontrol.php
Author: duncanb7 replied at 2024-04-26 22:03:10
@, what is that mean? it works fine as you suggest, Why ? Please explain a little bit.
Thanks
Duncan
Thanks
Duncan
Expert: Rob Jurd replied at 2024-04-26 21:51:49
If you want to suppress output warnings from loadHTMLFile($url), put an @ sign in front. This even works in:<?php$load = @$dom->loadHTMLFile($url);?> 1:2:3:4:
Expert: Ray Paseur replied at 2024-04-26 21:50:55
Can't help you with number two - I've never wanted to design an app around tolerance for a fatal error. But for the first one, you can use the @ notation:
Something like this...
$thing = @file_get_contents($url);
if ($thing === FALSE) echo "$url DID NOT WORK OUT WELL BUT WE SUPPRESSED THE ERROR";
Something like this...
$thing = @file_get_contents($url);
if ($thing === FALSE) echo "$url DID NOT WORK OUT WELL BUT WE SUPPRESSED THE ERROR";