Found 1046 Articles for PHP

time_nanosleep() function in PHP

George John
Updated on 30-Dec-2019 06:46:17

38 Views

The time_nanosleep() function delays execution of the current script for few seconds and nanoseconds.Syntaxtime_nanosleep(sec, nsec)Parameterssec − The number of seconds to delay the script.nsec − The number of nanoseconds to delay the script.ReturnThe time_nanosleep() function returns true on success.Example Live DemoOutputThe following is the output.02:57:04 02:57:06 02:57:08

sleep() function in PHP

Ankith Reddy
Updated on 30-Dec-2019 06:46:44

682 Views

The sleep() function delays execution of the current script for short time period.Syntaxsleep(sec)Parameterssec− The number of seconds to delay the script.ReturnThe sleep() function returns zero on success.Example Live DemoOutputThe following is the output.02:54:50 02:54:52 02:54:57

show_source() function in PHP

Arjun Thakur
Updated on 30-Dec-2019 06:44:49

126 Views

The show_source() function outputs a file with the PHP syntax highlighted.Syntaxshow_source(file, return)Parametersfile − The file name to display.return − If this parameter is set to true, this function will return the highlighted code as a string, instead of printing it out. Default is false.ReturnThe show_source() function returns the highlighted code as a string instead of printing it, if the return parameter is set to true otherwise, it returns true on success, or false on failure.ExampleThe following is an example, wherein we are using a test file ("new.php") to output the file with the PHP syntax highlighted.         ... Read More

php_strip_whitespace() function in PHP

Chandu yadav
Updated on 30-Jul-2019 22:30:23

67 Views

The php_strip_whitespace() function returns source with stripped comments and whitespace. Syntax php_strip_whitespace(file_path) Parameters file_path − The path of file. Return The php_strip_whitespace() function returns stripped source code on success. Example The above code strip all the comments and whitespace.

pack() function in PHP

George John
Updated on 30-Dec-2019 06:43:36

231 Views

The pack() function packs data into a binary string.Syntaxpack(format , args)Parametersformat − The format to use. Here are the possible values −a − NUL-padded stringA − SPACE-padded stringh − Hex string, low nibble firstH − Hex string, high nibble firstc − signed charC − unsigned chars − signed short (always 16 bit, machine byte order)S − unsigned short (always 16 bit, machine byte order)n − unsigned short (always 16 bit, big endian byte order)v − unsigned short (always 16 bit, little endian byte order)i − signed integer (machine dependent size and byte order)I − unsigned integer (machine dependent size and ... Read More

ignore_user_abort() function in PHP

Ankith Reddy
Updated on 30-Dec-2019 06:42:50

337 Views

The ignore_user_abort() function sets whether a remote client can abort the running of a script.Syntaxignore_user_abort(setting)Parameterssetting − True ignores user aborts in a script (the script will continue to run). This is false by default i.e. client aborts will cause the script to stop runningReturnThe ignore_user_abort() function returns previous value of the user-abort setting.ExampleThe following is an example that sets to false i.e. the default. Client aborts will cause the script to stop running.OutputThe following is the output.0

highlight_string() function in PHP

Arjun Thakur
Updated on 30-Dec-2019 06:41:56

115 Views

The highlight_string() function outputs a string with the PHP syntax highlighted.Syntaxhighlight_string(string, return)Parametersstring − The string to highlight.return −If this parameter is set to true, this function will return the highlighted code as a string, instead of printing it out. default is false.ReturnThe highlight_string() function returns true on success, or false on failure.ExampleThe following is an example that output a string with the PHP syntax highlighted.               OutputThe following is the output.Hello world!

highlight_file() function in PHP

Chandu yadav
Updated on 30-Dec-2019 06:39:35

121 Views

The highlight_file() function outputs a file with the PHP syntax highlighted.Syntaxhighlight_file(file, return)Parametersfile − The file name to display.return − If this parameter is set to true, this function will return the highlighted code as a string, instead of printing it out. default is false.ReturnThe highlight_file() function returns the highlighted code as a string instead of printing it. Returns true on success, or false on failure, otherwise.ExampleThe following is an example, wherein we are using a test file ("new.php") to output the file with the PHP syntax highlighted.               OutputThe output of the browser. ... Read More

get_browser() function in PHP

George John
Updated on 30-Dec-2019 06:37:56

697 Views

The get_browser() function looks up the user's browscap.ini file and returns the capabilities of the user's browser.Syntaxget_browser(user, return_array)Parametersuser − The name of HTTP user agent.return_array − If this parameter is set to true, the function will return an array instead of an object.ReturnThe get_browser() function returns object or array with information about browser of user.ExampleNote − The result will vary system to system.ExampleOutputThe following is the output.Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/70.0.3538.110 Safari/537.36

exit() function in PHP

Chandu yadav
Updated on 30-Dec-2019 06:36:53

935 Views

The exit() function prints a message and exits the current script.Syntaxexit(msg)Parametersmsg − The message to write before exiting the script.ReturnThe exit() function returns nothing.Example

Advertisements