← CodePrimer
PHP Beginner Basics

PHP scalar data types

What data types does PHP have?

string, int, float, bool, array, object, null.

Sample
<?php
$str = 'Hello';
$int = 42;
$float = 19.99;
$bool = true;
$none = null;
var_dump($str, $int, $float, $bool, $none);

Notes

var_dump shows type and value — great for debugging.

Keywords: types · string · int · float · bool · null

Related

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share