The following functions affect the operation of PHP. Some of them alter configuration variables. Others cause a script to stop executing for a period of time.
boolean bcscale(integer scale)
The bcscale function sets the default scale for the functions that perform math on arbitrary-precision numbers. The scale is the number of digits after the decimal point.
Calling C's stat function may take a considerable amount of time. To increase performance, PHP caches the results of each call. When you use a function that relies on stat, the information from the cache is returned. If information about a file changes often, you may need to clear the stat cache. The functions that use the stat cache are: stat, file_exists, fileatime, filectime, fileinode, filegroup, fileowner, fileperms, filesize, filetype.
The define_syslog_variables function emulates the configuration directive of the same name. It causes the constants for use with the system log to be created as variables. The functions that interact with the system log are closelog, openlog, and syslog.
boolean dl(string extension)
Use the dl function to load a dynamic extension module. The function returns FALSE if the module could not be loaded. The path to these modules is set in php.ini, so you need type only the name of the module file.
integer error_reporting(integer level)
The error_reporting function sets the level of error reporting and returns the previous value. The level argument is a bitfield, so use the bitwise OR operator (|) to put together the type of error reporting you would like. By default PHP uses a level of seven, which is Errors, Warnings, and Parser Errors.
boolean ignore_user_abort(boolean ignore)
Calling ignore_user_abort with a TRUE value for the ignore argument will cause PHP to continue executing even when the remote client abruptly closes the connection. The previous setting is returned. You may call ignore_user_abort with no argument, in which case no change is made.
string ini_alter(string directive, string value)
Use ini_alter to override the value of one of the directives in the php.ini file. The setting is for your script only. The file itself is not changed.
string ini_get(string directive)
The ini_get function returns the value of one of the directives in the php.ini file.
The ini_restore function returns the named directive to the value in the php.ini file. See ini_get for an example of use.
You may use magic_quotes_runtime as an alias to set_magic_quotes_ runtime.
Use register_shutdown_function to cause PHP to execute a function after it has parsed the entire script, including anything outside PHP tags. The shutdown function will also be executed in the event of an error, timeout, or user abort. Keep in mind that the shutdown function may be called after the connection to the browser has been shut down, in which case using print makes little sense. In other words, this isn't a good way to debug. You may register more than one shutdown function. Each will be executed in the order they were registered.
integer set_magic_quotes_runtime(boolean setting)
Use set_magic_quotes_runtime to change whether quotes are escaped in data pulled from a database. The original value is returned.
//turn off magic_quotes_runtime
string setlocale(string category, string locale)
The setlocale function modifies the locale information for PHP and returns the new locale specification. FALSE is returned if an error occurs. The locale determines things such as whether to use a comma or a period in floating-point numbers. Locale does not affect how you write PHP scripts, only the output of some functions.
If the category argument is an empty string, the values for the categories will be set from environment variables. If the category argument is zero, the current setting will be returned.
This function wraps the C function of the same name, so it's a good idea to check out the man page. PHP accepts some categories that have no effect on PHP itself. Also, PHP does not necessarily accept all the valid categories your operating system offers.
Location codes differ with operation systems. In general they take the form of language_country—that is, a language code followed by an optional underscore and a country code. If you are using Windows, Visual C's help file lists all the languages and countries.<?
Use set_time_limit to override the default time a script is allowed to run, which is usually set to 30 seconds inside php.ini. If this limit is reached, an error occurs and the script stops executing. Setting the seconds argument to zero causes the time limit to be disabled. Each time the set_time_limit function is called, the counter is reset to zero. This means that calling set_time_limit (30) gives you a fresh 30 seconds of execution time. The time-limit functionality does not operate in Windows. Scripts will execute until finished.
The sleep function causes execution to pause for the given number of seconds.
The usleep function causes execution to pause for the given number of microseconds. There are a million microseconds in a second.
PHP Related Interview Questions
|PHP Interview Questions||MySQL Interview Questions|
|PHP+MySQL Interview Questions||Drupal Interview Questions|
|MYSQL DBA Interview Questions||PHP5 Interview Questions|
|WordPress Interview Questions||Joomla Interview Questions|
|CakePHP Interview Questions||CodeIgniter Interview Questions|
|PHP7 Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.