Php Data Type

Sujitha

 Data Type in PHP

           PHP supports several data types, each designed to handle different types of values.

Here some commonly data type:
    
  1. String
  2. Float
  3. Integer
  4. Boolean
  5. Array
  6. Object
  7. Null
  8. Resource
  9. Callable
  10. Iterable

String

       Represents sequences of characters, enclosed in single or double quote.

$name="santhosh";

Float

       Represents numbers with decimal points or in exponential form.

$price=68.56;

Integer

     Represents whole numbers, positive or negative, without decimal points.

$age=19;

Boolean

     Represents a true or false value.

$is_logged_in= true;

Array

      Represents an ordered collection of value, often used to store multiple values in a single variable.

$color =('red','blue','yellow');

Object

        Represents an instance of a user-defined class. Objects can contain properties and methods.

Null

       Represents a variable with no value assigned to it.

Resource

      Represents a reference to an external resource, like a database connection or a file handle.

Callable 

       Represents a callback function, used in contexts like function callbacks or method callbacks.

Iterable

        Represents collections that can be iterated over, introduced in PHP 7.1.
Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send