Câu hỏi phỏng vấn PHP
Câu hỏi

What is the use of ini_set() ?

Câu trả lời

The ini_set() function in PHP is used to set the value of a PHP configuration option at runtime. It allows you to modify the behavior of PHP by changing the values of its built-in configuration directives, also known as php.ini settings.

Here are some common use cases for ini_set():

Modifying Error Reporting

You can use ini_set() to change the level of error reporting in your script. For example, to display all errors and warnings:

php Copy
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);

Setting the Default Time Zone

If your server doesn't have the default time zone set, you can use ini_set() to set it for your script:

php Copy
ini_set('date.timezone', 'America/New_York');

Increasing the Memory Limit

If your script requires more memory than the default limit, you can increase it using ini_set():

php Copy
in...
entry

entry

Gợi ý câu hỏi phỏng vấn

junior

In PHP, objects are they passed by value or by reference?

middle

Explain the difference between shell_exec() and exec()

junior

Explain how we handle exceptions in PHP?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào