Difference between revisions of "Hello, World! (php)"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
 
   echo "Hello World!";
 
   echo "Hello World!";
 
   echo "We are learning PHP!";
 
   echo "We are learning PHP!";
 +
 +
== Other examples ==
 +
<?php
 +
  echo "Hello World! \n";
 +
  echo "We are a new app! \n";
 +
 +
  $currentDate = date('Y-m-d h:i:s A'); // Format: YYYY-MM-DD hh:mm:ss AM/PM
 +
  echo "Today is: $currentDate \n"; // Output: 2024-02-15 06:23:25 PM
 +
 +
  echo "We are running PHP version: ";
 +
  echo phpversion ();
 +
 +
  # For more information
 +
  #phpinfo ();
  
 
== Related ==
 
== Related ==

Revision as of 14:26, 15 February 2024

<?php
  echo "Hello World!";
  echo "We are learning PHP!";

Other examples

<?php
 echo "Hello World! \n";
 echo "We are a new app! \n";

 $currentDate = date('Y-m-d h:i:s A'); // Format: YYYY-MM-DD hh:mm:ss AM/PM
 echo "Today is: $currentDate \n"; // Output: 2024-02-15 06:23:25 PM 

 echo "We are running PHP version: ";
 echo phpversion ();

 # For more information
 #phpinfo ();

Related

See also

Advertising: