Posts Tagged with 'PHP'
What is difference between echo and print?
PHP |What is the difference between echo and print? PHP echo and print both are used to display the output in PHP. Both can be used with or without parenthesis. The differences are small echo …
What is difference between strstr() and stristr() function ?
strstr() and stristr() strstr() and stristr() both are use to find first occurence of a string, but the differences are strstr( ) is case sensitive where as stristr( ) is case insensitive. strstr() – …
How can you enable errors in PHP ?
Enable errors in PHP There are two ways to enable error reporting in your PHP scripts: 1. You can add the following function in the the script: error_reporting(E_ALL); 2. You can add the following option in …
What is difference between == and === operator ?
PHP | What is difference between == and === operator? "==" and "===" The two operators are known as comparison operators. "==" (i.e. equal) and === (i.e. identical) both are use to check values are …
How to send mail in PHP ?
Send mail in PHP The mail() function allows you to send emails directly from a script. mail(to,subject,message,headers,parameters); Description of parameters to Required. Specifies the receiver's email id subject Required. Specifies the subject of the …
How we can check data type of any variable in php ?
PHP | Check data type in php | gettype() | var_dump() By using gettype() function we can check the data type of a variable. we can also use var_dump() function for the same. gettype() <?php echo …
What are data types in php?
PHP | What are data types in PHP? Variables can store data of different types, and different data types can do different things. PHP supports the following data types: String Integer Float (floating-point numbers - …
What are scopes of variable in php?
PHP | What are the scopes of variables in PHP? Scopes define the visibility of a variable. In PHP, variables can be declared anywhere in the script. The scope of a variable is the part …
How to convert an array to string ?
PHP | How to convert an array to a string? array to string By using implode function we can convert any array to string. In implode function first parameter is separator which specifies what to …
How to convert a string to array ?
PHP | How to convert a string to an array? string to array There is a function in PHP called explode() which is used to convert any string to an array. <?php $str = …
What are superglobal/global variables ?
PHP | What are superglobal/global variables? Superglobal is out of scope limitation. These variables can be accessed from any function, class, or file without doing anything special such as declaring any global variable, etc. These …
What is difference between require() and include() ?
What is difference between require() and include() ? The require() function is identical to include(), except that it handles errors differently. If an error occurs, the include() function generates a warning, but the script will …
What is difference between require() and require_once() ?
PHP | require() and require_once() Both require() and require_once() is use to include a file but the difference is required_once() function checks if the file already included or not where require() function does not check. …
How to avoid errors in PHP ?
PHP | How to avoid errors in PHP? We can use PHP inbuilt function error_reporting(0) to avoid all errors in PHP file. <?php error_reporting(0); ?>
How we can increase default timeout of session ?
PHP | Increase default session timeout The "session.gc_maxlifetime" is use to modify the default timout of session. server should keep session data for AT LEAST 1 hour by using the below code. It increase session …