making a variable a string and an integer php code example Example: php to int $num = "3.14"; $int = (int)$num;