Find nth largest salary from employees table?
By using following query we can find out the nth largest salary from employees table. SELECT salary FROM `employees` ORDER BY salary DESC LIMIT 1 OFFSET n-1 In the above query n is replaced by …
Why we use isset in PHP?
PHP | isset() The isset () function is used to check whether a variable is set or not. It returns true if a variable is set otherwise it returns false. <?php $var = "StudyZone4U.com"; …
How to stop execution of PHP script ?
PHP | Stop the execution of php script | exit() funtion By using exit() function we can stop the execution of php script. <?php $a = 10; $b = 20; $c = $a+$b; exit(); …
How to redirect a page in PHP?
PHP | Redirect PHP header() function is used to redirect a page to another page. It supplies raw HTTP headers to the browser and redirects it to another location. The redirection script should be at …
What is :: operator and in what case we use it in php?
PHP | :: operator | scope resolution operator This operator is known as the scope resolution operator. And this operator is used to access the static members of the class. To access static members of a …
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 = …