Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This worked for me.</p> <pre><code>/** * return phpinfo() results as an array * * @credit http://php.net/manual/en/function.phpinfo.php#106862 * @param void * @return array */ function phpinfo_array(){ ob_start(); phpinfo(); $info_arr = array(); $info_lines = explode("\n", strip_tags(ob_get_clean(), '&lt;tr&gt;&lt;td&gt;&lt;h2&gt;')); $cat = 'general'; foreach($info_lines as $line){ preg_match('/&lt;h2&gt;(.*)&lt;\/h2&gt;/', $line, $title) ? $cat = preg_replace('/\s+/', '_', strtolower(trim($title[1]))) : null; if(preg_match('/&lt;tr&gt;&lt;td[^&gt;]+&gt;([^&lt;]*)&lt;\/td&gt;&lt;td[^&gt;]+&gt;([^&lt;]*)&lt;\/td&gt;&lt;\/tr&gt;/', $line, $val)){ $subcat = preg_replace('/\s+/', '_', strtolower(trim($val[1]))); $info_arr[$cat][$subcat] = $val[2]; } elseif(preg_match('/&lt;tr&gt;&lt;td[^&gt;]+&gt;([^&lt;]*)&lt;\/td&gt;&lt;td[^&gt;]+&gt;([^&lt;]*)&lt;\/td&gt;&lt;td[^&gt;]+&gt;([^&lt;]*)&lt;\/td&gt;&lt;\/tr&gt;/', $line, $val)){ $subcat = preg_replace('/\s+/', '_', strtolower(trim($val[1]))); $info_arr[$cat][$subcat] = array('local' =&gt; $val[2], 'master' =&gt; $val[3]); } } return $info_arr; } // output proper response code $phpinfo = phpinfo_array(); $configure = (@isset($phpinfo['general']['configure_command'])) ?: null; // properly account for FastCGI if ($configure &amp;&amp; preg_match('/--enable-fastcgi/', $configure)){ // fastcgi response header('Status: 403 Access is forbidden'); } else { // http response header('HTTP/1.0 403 Access is forbidden'); } </code></pre>
 

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