Found 6 Questions For PHP

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

Write PHP Program To Print Sum Of Digits

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

Write PHP Program To Check Prime Number

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

How To Clean Up Unnecessary Code From WordPress Header Without Plugins

Updated on 28-Oct-2021 9:44:44
How To Clean Up Unnecessary Code From WordPress Header Without Plugins How To Remove Weblog Client Link Example: <link rel="EditURI" type="application/rsd+xml" title="RSD" href="" /> To remove the EditURI/RSD link from WordPress header, paste the below code into your theme’s function.php. remove_action ('wp_head', 'rsd_link'); How To Remove Windows Live Writer Manifest Link Example: <link rel="wlwmanifest" type="application/wlw... Read More

How to Install PHP 8 on Ubuntu 20.04

Updated on 27-Oct-2021 5:27:23
PHP is arguably one of the most widely used server-side programming languages. It’s the language of choice when developing dynamic and responsive websites. In fact, popular CM platforms such as WordPress, Drupal, and Magento are based on PHP. Some other notable benefits of using PHP include the following: Easy to learn; the syntax is simple and well organized. PHP code can easily be edited at any time without messing up the entire code; this flexibility is very important for scripting ... Read More