Datatype in PHP


Prev Tutorial Next Tutorial

Datatype in PHP

PHP data types are used to hold different types of data or values. PHP supports the following data types:

  • String
  • Integer
  • Float
  • Boolean
  • Array
  • Object
  • NULL
  • Resource

String

A string is a sequence of characters, for example "Hello world!".

Syntax

<?php

$x = "Hello world!";
$y = 'Hello world!';

echo $x;
echo "</br>"; 
echo $y;

?>

Output

Hello world! Hello world!

Prev Tutorial Next Tutorial

Advertisements




Download Projects