Data Types uses in PHP

PHP Date Types

Variables will store information of various sorts, and totally different information sorts will do various things.

PHP supports the subsequent information types:

  • String
  • Integer
  • Float (floating purpose numbers - conjointly known as double)
  • Boolean
  • Array
  • Object
  • NULL
  • Resource
  • PHP String

A string may be a sequence of characters, like "Hello world!".

A string is any text within quotes. you'll use single or double quotes:

Example
<?php 
$x = "Hello world!";
$y = 'Hello world!';

echo $x;
echo "
"; 
echo $y;
?>

You also can read this below article which is very useful for PHP & Software Developer and Digital Marketing.


How to Define a variable in PHP

How to define array in PHP

Function use in PHP

Applied AI in Software Development

How Digital Marketing Works

Software Improvement by Data Improvement.

PHP Number

An whole {number|number} information sort may be a non-decimal number between -2,147,483,648 and 2,147,483,647.

Rules for integers:

An number should have a minimum of one digit
An number should not have a percentage point
An number is either positive or negative
Integers is per 3 formats: decimal (10-based), hex (16-based - prefixed with 0x) or positional notation (8-based - prefixed with 0)
In the following example $x is AN number. The PHP var_dump() operate returns the information sort and value:

Example

<?php 
$x = 5985;
var_dump($x);
?>

PHP Float

A float (floating purpose variety) may be a number with a percentage point or variety in exponential kind.

In the following example $x may be a float. The PHP var_dump() operate returns the information sort and value:

Example

<?php 
$x = 10.365;
var_dump($x);
?>

PHP Boolean

A Boolean represents 2 attainable states: TRUE or FALSE.

$x = true;
$y = false;

Booleans area unit typically utilized in conditional testing. you may learn a lot of concerning conditional testing during a later chapter of this tutorial.

PHP Array

An array stores multiple values in one single variable.

In the following example $cars is AN array. The PHP var_dump() operate returns the information sort and value:

Example

<?php 
$cars = array("Volvo","BMW","Toyota");
var_dump($cars);
?>

PHP Object

An object may be a information sort that stores information {and information|and knowledge|and information} on a way to method that data.

In PHP, AN object should be expressly declared.

First we have a tendency to should declare a category of object. For this, we have a tendency to use the category keyword. a category may be a structure which will contain properties and methods:

Example

<?php
class automobile {
operate Car() ">
}

// produce AN object
$herbie = new Car();

// show object properties
echo $herbie->model;
?>

PHP NULL worth

Null may be a special information sort which might have only 1 value: NULL.

A variable of information sort NULL may be a variable that has no worth appointed thereto.

Tip: If a variable is formed while not a price, it's mechanically appointed a price of NULL.

Variables also can be empty by setting the worth to NULL:

Example
<?php
$x = "Hello world!";
$x = null;
var_dump($x);
?>

https://flattr.com/@chevrolet

http://ttlink.com/chevrolet

https://pbase.com/profile

https://www.intensedebate.com/people/Metrochevrolet

http://www.icyte.com/users/show/544257

http://www.graszonline.pl/profile/1635376/HyundaiService.html

https://profiles.wordpress.org/chevroletservice/

https://mootools.net/forge/profile/Chevrolet+Service

https://www.steinberg.net/forums/memberlist.php?mode=viewprofile&u=158344

https://www.spreaker.com/user/11463046

http://www.brijj.com/chevrolet-service-1?route=head

https://www.skillshare.com/profile/Chevrolet-Service/1999580

https://flattr.com/@Delhiford

http://ttlink.com/delhiford

https://pbase.com/profile

https://www.intensedebate.com/people/Delhiford

http://www.icyte.com/users/show/544105

http://www.graszonline.pl/profile/1635256/delhiford.html

https://profiles.wordpress.org/delhiford/

https://mootools.net/forge/profile/Delhiford

https://www.steinberg.net/forums/memberlist.php?mode=viewprofile&u=158305

https://www.spreaker.com/user/11462811

http://www.brijj.com/delhi-ford?route=head

https://www.skillshare.com/user/delhiford

https://www.sbnation.com/users/Delhiford

http://bbs.vernee.cc/home.php?mod=space&uid=92306


Comments

Post a Comment

Popular posts from this blog

Software Development Services in India.

Full Syllabus of PHP

Every developer should have a blog - Software Development Delhi