I'm pulling results from an XML file and one of the values (an actual numeric ID) is being read as a string. The value is trimmed and has no whitespace. I observed this by checking with is_numeric:
if (!is_numeric($id))
{
echo "<p>$id is NOT numeric";
} else {
echo "<p>$id is numeric";
}
The response of a variable 643394 is:
643394 is NOT numeric
PHP has a function to convert an integer to a string (strtoint), but I didn't find a function to go the other way (inttostr).
Is it possible to convert string "1234" to integer 1234?