1phpCopy<?php
2$variable = "10";
3$integer = (int)$variable;
4echo "The variable $variable has converted to a number and its value is $integer.";
5echo "\n";
6
7$variable = "8.1";
8$float = (float)$variable;
9echo "The variable $variable has converted to a number and its value is $float.";
10?>
11