Type Specifiers in Action
Binary: 1111011Character: {
Decimal: 123
Scientific: 1.234500e+2
Float: 123.450000
Octal: 173
String: 123.45
Hex (lower case): 7b
Hex (upper case): 7B
<?php
// Include the header file
include('includes/header.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Type Specifiers in Action</title>
<link rel="stylesheet" type="text/css" href="common.css" />
</head>
<body>
<h1>Type Specifiers in Action</h1>
<?php
$myNumber = 123.45;
printf( "Binary: %b<br/>", $myNumber );
printf( "Character: %c<br/>", $myNumber );
printf( "Decimal: %d<br/>", $myNumber );
printf( "Scientific: %e<br/>", $myNumber );
printf( "Float: %f<br/>", $myNumber );
printf( "Octal: %o<br/>", $myNumber );
printf( "String: %s<br/>", $myNumber );
printf( "Hex (lower case): %x<br/>", $myNumber );
printf( "Hex (upper case): %X<br/>", $myNumber );
?>
</body>
</html>
<?php
include('includes/footer.php');
?>