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 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 …
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 = …
Add bar chart in web page
Chart.js | Add bar chart in the webpage This is a simple example of using Chart.js to create a bar chart on the webpage. Step 1: Create a basic HTML file called "chart.html" <!DOCTYPE html> …
Django order_by query set
Django | order_by query set, ascending and descending order_by() The order_by function is used to sort the result-set in ascending or descending order. Ascending Order The order_by function sorts the records in ascending order by …
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 …
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 will be the output of $a and $b once code bellow is executed?
PHP | output of $a and $b once this code $a = '1'; $b = &$a; $b = "2$b" executed; Both $a and $b will output a string "21". Because the statement $b = &$a; sets …
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 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 can we know the number of days between two given dates using PHP?
Bellow code is used for the same $date1 = date(‘Y-m-d’); $date2 = ‘2006-08-15’; $days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24); echo $days;
What is the difference between primary key and unique constraints?
SQL | Difference between primary key and unique constraints There is only one primary key in a table. It creates the clustered index automatically and it cannot have NULL value whereas there can be multiple …
How can we know the number of days between two given dates using MySQL?
DATEDIFF function is use for finding the number of days between two given dates using MySQL DATEDIFF(‘2018-03-07′,’2017-01-01’)
Git add to add files to git
Git add | add files to git This command adds the working directory changes to the staging area. It allows to include the updates to a particular file in the next commit. Git add doesn't affect …
Ternary Operator in Python
Python | Ternary Operator python uses an if-else conditional statement in a single line to represent the Ternary Operator. [true] if [expression] else [false] Let's see an example of Ternary Operator a, b = …