how can I remove error messages without modify php.ini file

Recommended Answers

All 8 Replies

Fix the problems. Anything in specific?

its just a interview quetion some one ask me in interview
i know we can edit in php.ini file display_error to "no" so the error are not display but they ask me without changing in php.ini file how can we are not display errors in php file

by coding correctly? i guess ^_^

ini_set() function can override values set in PHP.INI

ok thankyou @pritaeas

Extending pritaeas' answer... you could use this:

<?php
    // This goes at the TOP of your file(s).
    ini_set("display_errors", false);
    error_reporting(0);

right,
php.ini file display_error to "no" so the error are not display but they ask me without changing in php.ini file how can we are not display errors in php file

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.