The mktime() function generates a timestamp for a specified date and time, defaulting to the current date and time if none are provided. The substr() function extracts a substring from a given string starting from a specified index. Example code snippets demonstrate the usage of both functions in PHP.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
12 views8 pages
WEB II Questions
The mktime() function generates a timestamp for a specified date and time, defaulting to the current date and time if none are provided. The substr() function extracts a substring from a given string starting from a specified index. Example code snippets demonstrate the usage of both functions in PHP.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8
mktime() Function: The mktime() function is
used to create the timestamp for a specific
date and time. If no date and time are provided, the timestamp for the current date and time is returned. echo date("2075/03/03"); what does substr() function do? Ans: This function gives the substring of a given string from a given index. Example: <?php $a="This is not easy"; echo (substr($a,2)); ?> //output; is is not easy
<?php $t=time(); $d=date("yy/m/d"); echo "current time is".$t."<br>"; echo "current date is".$d; ?>