Typecasting problems
Posted: Wed Jul 16, 2008 5:23 am
I have this string. When I var_dump() the string I get this:
Soooo... how do I get this string to be int(174)?
but I need to use this string as an int in a math problem. I have tried many things but nothing has worked. Here is what I have tried and what it outputs to:string(10) "174"
Code: Select all
var_dump($matches[0]);//string(10) "174"
echo '<br>';
var_dump(intval($matches[0]));//int(0)
echo '<br>';
var_dump((int)$matches[0]);//int(0)
die();