Do you Know date, Array, push, To string in PHP | Php tutorials

  • 0 Replies
  • 1093 Views
*

Sharmait007

  • Newbie
  • *
  • 8
  • +0/-0
    • View Profile
Do you Know date, Array, push, To string in PHP | Php tutorials
« on: September 09, 2011, 03:45:39 AM »
The PHP date()
The PHP date() function is used to display time and date.
Syntax:
date(format,timestamp)
example:
<?

$d = date("F j, Y, g:i a");

?>
<?php
   echo date("Y-m-d");
   echo date("Y/m/d");
   echo date("M d, Y");
   echo date("F d, Y");
   echo date("D M d, Y");
   echo date("l F d, Y");
   echo date("l F d, Y, h:i:s");
   echo date("l F d, Y, h:i A");
?>

Array:
An array stores multiple values in one single variable.

In PHP, there are three kind of arrays:
•   Numeric array - An array with a numeric index
$names = array(“Akki”,”Jimmi”,”Joy”);

•   Associative array - An array where each ID key is associated with a value
$families = array
(“Griffin”=>array
( “sam”,” dino”, “john”),
“Jimmi”=>array
(“Glenn” ),
“Brown”=>array
(“Cmohan”, “rajesh”,”machi”));

•   Multidimensional array - An array containing one or more arrays
                         $ages = array(“sam”=>21, “dino”=>18, “john”=>20);
« Last Edit: September 09, 2011, 07:44:47 AM by Webhelpforums »

 




See Our Webmaster Tools for Windows and Mac

A1 Sitemap Generator
      
A1 Website Analyzer
      
A1 Keyword Research
      
A1 Website Download
      
A1 Website Search Engine
      
A1 Website Scraper