I’ve a problem. I’m scrapping a txt file and extracting an ID. The problem is that the data is not consistent and I have to evaluate the data.
Here is some code:
$a = "34";
$b = " 45";
$c = "ddd556z";
if ( ) {
echo "INTEGER";
} else{
echo "STRING";
}
I need test if the values $a, $b or $c are Integers. What is the best way of doing this? I have tested to “trim” and the use “is_int” but is not working as expected.
Can someone give me some clues?
The example below will work even if your “int” is a string
$a = "number";or
or
or (same as last)