Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP regex that finds PHP errors
    primarykey
    data
    text
    <p>I want PHP regex that can find errors on a page. So when I visit a site and crawl the page that I can list the errors on the site.</p> <p>Currently I have the following code:</p> <pre><code>preg_match('/&lt;b&gt;.+&lt;\/b&gt;:.+ in &lt;b&gt;\/.+&lt;\/b&gt; on line &lt;b&gt;[0-9]+&lt;\/b&gt;&lt;br( \/)?&gt;/msi',$html,$errors); </code></pre> <p>It can show if errors occurred, but it will not list them! I get the full html page in the array (<code>$errors[0]</code>)</p> <p>Could anybody help?</p> <p>EDIT: So I have a page with for example the following HTML-source, from which I want to extract the PHP errors:</p> <pre><code>&lt;b&gt;Warning&lt;/b&gt;: session_start() [&lt;a href='function.session-start'&gt;function.session-start&lt;/a&gt;]: The session id contains invalid characters, valid characters are only a-z, A-Z and 0-9 in &lt;b&gt;/home/.../public_html/articlescript/init.php&lt;/b&gt; on line &lt;b&gt;127&lt;/b&gt;&lt;br /&gt; &lt;br /&gt; &lt;b&gt;Warning&lt;/b&gt;: session_start() [&lt;a href='function.session-start'&gt;function.session-start&lt;/a&gt;]: Cannot send session cache limiter - headers already sent (output started at /home/.../public_html/articlescript/init.php:127) in &lt;b&gt;/home/.../public_html/articlescript/init.php&lt;/b&gt; on line &lt;b&gt;127&lt;/b&gt;&lt;br /&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;title&gt;... </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload