PHP Date and Time Function

Updated on 26-Jan-2023 14:42:35
In this tutorial, we will see how to get the date & time using the date() & time() function in PHP, we will also see the various formatting options available with these functions & understand their implementation through the examples.Date and time are some of the most frequently used operations in PHP while executing SQL queries or designing a website etc. PHP serves us with predefined functions for these tasks. Some of the predefined functions in PHP for date and time are discussed ... Read More

What does ‘<?=’ short open tag mean in PHP ?

Updated on 26-Jan-2023 14:40:35
The <?php is used to identify the start of a PHP document.In PHP whenever it reads a PHP document, It looks for:<?php ?> It process the codes in between the above tags only and leaves the other codes around them.For example :<?php     echo "Hello PHP !"; ?> Output :Hello PHP !Note : But a special case is when you write a PHP file the end tag can be omitted, Only the start tag is needed.The below code works fine as well:<?php    echo ... Read More

Advertisements

Updated on 16-oct-2001 12:00:00

Html Boilerplate

Updated on 25-Jan-2023 10:04:08
<!DOCTYPE html><html lang="en"><head>  <title>Hello, world!</title>  <meta charset="UTF-8" />  <meta name="viewport" content="width=device-width,initial-scale=1" />  <meta name="description" content="" />  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">  <link rel="stylesheet" type="text/css" href="style.css" />  <meta na... Read More

Write PHP Program To Print Sum Of Digits

PHP
Updated on 20-Jan-2023 21:11:30
PHP Program To Print Sum Of Digits : The below program gives the sum of two variables x and y. The PHP echo statement is used to output the text and sum value to the screen. In a similar way, codes can be written to get a sum of multiple variables in PHP. Example <!DOCTYPE html> <html> <body>   <?php $txt1 = "Sum of x and y is:"; $x = 1234; $y = 4321;   echo "<h3>" . $txt1 . "</h3>"; echo $x + $y; ?>   </body... Read More

Find Second largest element in an array using C Programming

Updated on 12-Jan-2023 0:25:36
Given an array of integers, our task is to write a program that efficiently finds the second largest element present in the array. Example: Input: arr[] = {12, 35, 1, 10, 34, 1} Output: The second largest element is 34. Explanation: The largest element of the array is 35 and the second largest element is 34 Input: arr[] = {10, 5, 10} Output: The second largest element is 5. Explanation: The largest element of the array is 10 and the second largest element is 5 Input: arr[] =... Read More

Advertisements

Updated on 16-oct-2001 12:00:00

How To Reduce the Array to 0 by decreasing elements by 1 or replacing at most K elements by 0

Updated on 14-Nov-2022 19:30:10
Given an array arr[ ] of N integers and a positive integer K, the task is to find the minimum number of operations required to reduce all array elements to 0 such that in each operation reduce any array element by 1 and independently at most K array element can be reduced to 0. Examples: Input: arr[ ] = {4, 1, 5}, K = 1 Output: 5 Explanation: Following are the operations performed to convert all array elements to 0: Here K = 1, So replace arr[2] by 0, converts arr[v] to {... Read More

How to Install Jenkins on Ubuntu

Updated on 28-Mar-2022 17:52:44
Jenkins is a software package for software developers. It’s used to automate parts of the testing, build, delivery, and deployment of software. This guide will help you install Jenkins on an Ubuntu 18.04 system. Prerequisites A system running Ubuntu 18.04 Bionic Beaver A user account with sudo privileges Access to a terminal window / command line (CTRL+ALT+T or search > terminal) Java 8 or 11 A Brief Note on Jenkins Jenkins is a CI/CD software platform tha... Read More

Advertisements

Updated on 16-oct-2001 12:00:00

Write PHP Program To Check Prime Number

PHP
Updated on 16-Mar-2022 8:40:06
PHP Program To Check Prime Number : The below program checks if a number is a prime or a composite number. The PHP echo statement is used to output the result on the screen. Example <!DOCTYPE html> <html> <body>   <?php $num = 13; $count=0; for ( $i=1; $i<=$num; $i++){ if (($num%$i)==0){ $count++; } } if ($count<3){ echo "$num is a prime number."; } else{ echo "$num is not a pri... Read More

Recursive program to linearly search an element in a given array using C

Updated on 15-Feb-2022 16:04:30
Given an unsorted array and an element x, search x in given array. Write recursive C code for this. If element is not present, return -1. Approach : The idea is to compare x with the last element in arr[]. If an element is found at the last position, return it. Else recur elmntSrch() for remaining array and element x. Program : /* * Approach : The idea is to compare x with the last element in arr[]. * If an element is found at the last position, return it. * Else recur el... Read More
1 2 39 Next
Advertisements

ads