Sharp Tutorial
Data Type and operator in PHP

Python

Java

C

C++

HTML/CSS

Java Script

PHP

SQL

C Programs

PHP Introduction

  • PHP home
  • PHP introduction
  • How to install and run
  • Syntax and Rule in PHP
  • Data type and operator
  • If else in php
  • Loop in php
  • Array in php
  • Sring in php
  • Function in php
  • Include in php

Working with Forms

  • Get and Post
  • Get Form input into PHP
  • Form Validation

PHP with MySQl

  • Connect PHP & Mysql
  • Insert using PHP Mysql
  • Select using PHP MySql
  • Delete Update using PHP Mysql
  • Login Page Example in PHP

Advanced PHP

  • Session in PHP
  • Cookies in PHP
  • File Handling in PHP
  • File Upload/Download PH

Object Oriented PHP

  • Class Obejct in PHP
  • Constructor in PHP
  • Destructor in PHP
  • Inheritance in PHP

Data Type in PHP

PHP variable declared with $ may store different type of values.There are following data types available in PHP. 

1 Integer (to store numeric values without decimal).

2 Float(To store decimal numbers sometimes also known as double).

3 String (To store string values written in single quote or in double quotes).

4 Boolean (It stores true or false only).

5 Array (Array used to store multiple values in a single variable.).

6 Object (Object is an instance of class and may store that class type values).

7 NULL (speial data type Null may store only null values)

8 Resource( special data type store not the value but references.)

Some Example on PHP variable types

 <html>
<body bgcolor="cyan">
<center>
<?php
$number=10;
$price=5.5;
$course="bca";
$status=true;
$city = array("Delhi","Noida","Mumbai");
echo"number=$number "."price=$price "."course=$course" ."status=$status "."city=$city[0]";
?>
</center>
</body>
</html>

out put of the above program is as follows

Operator in PHP

Operator is used to make some operation on the operands eg +,- = etc. Mainly used operators in php is as of following types.

1 Arithmetic operator (eg +,-, * ,/ etc).

2 Comparison Operator(To compare values eg. < ,>, <=,>=, == , != etc.).

3 Increment/Decrement Operator (++ , — operates on single operand).

4 Logical operators (and ,or, xor(&& , ||, !) etc ).

5 Assignment Operator(used to store right value to left variable.).

6 String operators (. to concatenates the given strings).

7Array operators  (+ union of the arrays, == checks if arrays are equals ,!= check arrays are not equals).

Enquiry about Course

Ask your Question

Click Here

Sharp (2) Tutorials

Video/ C Introduction

Watch video in full size

Video tutorial

Follow by Email
Facebook
Facebook
fb-share-icon
YouTube
Copyright © Sharp Tutorial
Build with WordPress
Wordpress Social Share Plugin powered by Ultimatelysocial
Sharp Tutorial