0 votes
1.3k views
in Programming by (300 points)
is there any easy tutorials where I can understand about PHP datatypes with examples?

1 Answer

0 votes
by

PHP supports the following data types :

  1. String
  2. Integer
  3. Float
  4. Boolean
  5. Array
  6. Object
  7. NULL

 

1 -   String

A string is like "Hello Friend!", you can write any text inside single or double-quotes.

Example -

<?php

// Double quotes

$a = "Hello Short Tutorials";

// Single quotes

$a = 'Hello Short Tutorials';

echo $a; // Output will be same for single and double quotes

// if you want to see data type of your variable, so you can use var_dump() var_dump($a); 

?>

For more information check out this link and know about PHP Data types 

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated