0% found this document useful (0 votes)
3 views2 pages

PHP Solve

The document outlines key features of PHP, including its open-source nature, cross-platform compatibility, and server-side scripting capabilities. It also explains four data types in PHP: Integer, Float, String, and Boolean, detailing their characteristics and ranges. A code example demonstrates the use of these data types in PHP.

Uploaded by

shivamteli07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

PHP Solve

The document outlines key features of PHP, including its open-source nature, cross-platform compatibility, and server-side scripting capabilities. It also explains four data types in PHP: Integer, Float, String, and Boolean, detailing their characteristics and ranges. A code example demonstrates the use of these data types in PHP.

Uploaded by

shivamteli07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PHP Solve

1. State the features of php


Solution:
 Open Source
 Cross-Platform
 Server-Side Scripting
 Database Support
 Fast Performance
 Error Handling
2. List and explain any four data types in PHP
Solution:
Data types are used to hold different types of data or values.
PHP supports 8 primitive data types that can be categorized in 3 types :

Integer:

 Holds whole numbers (positive & negative) without decimals.


 Range: -2,147,483,648 to +2,147,483,647.
 Can be defined in decimal (base 10), hexadecimal (base 16), octal (base 8), or
binary (base 2).
 Default base: Decimal.
 Octal: Starts with 0 (e.g., 053).
 Hexadecimal: Starts with 0x (e.g., 0x10).

(ii) Float : Floating point numbers represents numeric values with decimal
points (real numbers) or a number in exponential form. The range of floating
point values are 1.7E-308 to 1.7E+308.
(iii) String : A string is a sequence of characters. A string are declares using
single quotes or double quotes.
(iv) Boolean : The Boolean data types represents two values, true(1) or
false(0).
Code:
<?php
$a=11;
$b=11.22;
$c="Hello PHP";
$d=True;
var_dump($a);
var_dump($b);
var_dump($c);
var_dump($d);
?>
Output:

You might also like