Wed, July 6, 2022
https://devcodepro.comdevcodepro
Home · Latest · Trends
5

Log and display all errors, warnings and notices

Log and display all errors, warnings and notices into a file
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set("error_log", "myerrors.log");
error_reporting(E_ALL);
AD ยท www.interserver.net/r/240055 

Interserver | Standard & VPS Cloud Hosting | $2.50 /Month

Flexible VPS hosting platform to deploy your online projects. Economical and balanced between processor cores, memory and storage
rated 5 times (5) (0)
comments: 0 / hits: 2402  / 5 years ago, sat, sep 16, 17, 04:52:35
More From » PHP
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
Login with Google
 
Share
Posted
giles
Member since Sep 16, 2017
Total Code Snippets: 2
Total Comments: 0
Location: n/a
giles snippets
5 years ago, sat, sep 30, 17, 1:28:06
<?php /** * totext() * * @param mixed $content * @return */ function totext($content) { $pregarray = array( '/(<a\b[^>]*>|<\/a>)/si' => "", '/\r/si' => "", '/\n/si' => "", '/&nbsp;/si' => " ", '/&middot;/si' => " ", '/<(img)\b[^>]*alt=\"([^>"]+)\"[^>]*>/si' => "", '/<(img)\b[^>]*>/si' => "", '/<head\b[^>]*>.*?<\/head>/si' => "", '/<script\b[^>]*>.*?<\/script>/si' => "", '/<style\b[^>]*>.*?<\/style>/si' => "", '/<div\b[^>]*>\>/si' => "", '/<nav\b[^>]*>.*?<\/nav>/si' => "", '/<footer\b[^>]*>.*?<\/footer>/si' => "", '/<source\b[^>]*>.*?<\/source>/si' => "", '/<(source)\b[^>]*>/si' => "", '/<\/?(div|b|span|dt|dt|nav|dd|li|table|tr|article|header|td|ul|ol|dl|aside|section|main|p|h1|h2|h3|h4|h5|h6)[^>]*\>/si' => " ", '/<form(.*?)<\/form>/si' => "", '/<input\b[^>]*>/si' => ""); $content = preg_replace(array_keys($pregarray), array_values($pregarray), $content); $content = strip_tags($content); $content = preg_replace('/[ \t]+/', ' ', preg_replace('/\s*$^\s*/m', "\n", $content)); return $content; } ?> <?php $content = 'My page content'; $content = totext($content); echo $content; ?>
comments: 0 / hits: 4500
PHP