php what type of variable is it
echo gettype($var1)."\n";
echo gettype($var2)."\n";
echo gettype($var3)."\n";
php what type of variable is it
echo gettype($var1)."\n";
echo gettype($var2)."\n";
echo gettype($var3)."\n";
PHP Variables
<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
?>
what are the different types of PHP variables?
There are 8 data types in PHP which are used to construct the variables:
1. Integers - are whole numbers without a decimal point, like 4195.
2. Doubles - are floating-point numbers, like 3.14486 or 49.1.
3. Booleans - have only two possible values either true or false.
4. Null - is a special type that only has one value:Null.
5. Strings - are sequences of characters.
6. Arrays - are named and indexed collection of other values.
7. Objects - are instances of programmer-defined classes, which can package up both other kinds of values and functions that are specific to the class.
8. Resources- are spacial varibles that hold references to resources external to PHP.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us