
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1060 Articles for PHP

174 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!

227 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

1K+ 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

1K+ Views
The eval() function evaluates a string as PHP code.Syntaxeval(code)Parameterscode − The PHP code to be evaluated.ReturnThe eval() function returns null unless a return statement is called in the code string. Then the value passed to return is returned. if there is a parse error in the code string, eval() returns false.Example Live DemoOutputThe following is the output.This is $one $two! This is Demo text!

299 Views
The defined() function in PHP checks that constant exists or not.Syntaxdefined(name)Parametersname− The name of constant.ReturnThe defined() function returns true if the constant exists otherwise false.ExampleThe following is an example that checks whether a constant exist. Live DemoOutputThe following is the output.1

848 Views
The define() function defines a constant.Syntaxdefine(const_name,value,case_insensitive)Parametersconst_name − The name of the constant.value − The value of the constant.case_insensitive − The constant name should be case-insensitive.ReturnThe define() function returns true on success or false on failure.ExampleThe following is an example that defines a constant. Live DemoOuptutThe following is the output.This is it!

262 Views
The constant() function returns the value of a constant.Syntaxconstant(const)Parametersconst − The name of the constant to checkReturnThe constant() function returns the value of a constant and NULL if the constant is not defined.ExampleThe following is an example that defines a constant. Live DemoOutputThe following is the output.This is it!

149 Views
The FILTER_CALLBACK constant calls a user defined function to filter the value.ReturnThe FILTER_CALLBACK constant does not return anything.ExampleThe following is an example that converts the case of a string. Here, existing function in PHP is taken. Live DemoOutputThe following is the output.demo text!