Answers for "php text to number"

PHP
3

convert string to int php

s = "123";
echo intval(s); // 123

s = "hello";
echo intval(s);	//0
Posted by: Guest on November-13-2020
8

php to int

$num = "3.14";
$int = (int)$num;
Posted by: Guest on April-13-2020
0

Convert a String to a Number in PHP

phpCopy<?php  
$variable = "45";
settype($variable, "integer");
echo "The variable has converted to a number and its value is $variable.";  
?>
Posted by: Guest on April-23-2021
0

Convert a String to a Number in PHP

phpCopysettype($variableName, "typeName");
Posted by: Guest on April-23-2021

Browse Popular Code Answers by Language