← CodePrimer
PHP
Beginner
Basics
PHP scalar data types
What data types does PHP have?
string, int, float, bool, array, object, null.
<?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
HTML
HTML headings h1–h6
How do I create page headings?
CSS
Three ways to apply CSS
What are inline, internal, and external CSS?
PHP
Embed PHP inside HTML
How do I mix PHP and HTML?
HTML
Paragraphs and line breaks
How do I break text into paragraphs?
CSS
CSS box model
Why is my element wider than expected?
PHP
PHP comments
How do I write comments in PHP?