PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
if(isset($number_of_rows))
{
$prints=$number_of_rows;
}
else
{
$prints=100;
}
if (is_int($prints)){
echo' IT IS AN INTEGER';
}
if(is_string($prints)){
echo' IT IS A STRING';
echo $prints;
}
?>
If i have entered $number_of_rows it comes from a html form:
Are you sure? I've been able to reproduce 'Unsupported operand types' with arrays and objects only; it works perfectly with strings and numbers...
you can var_dump($variable) to see it's real type before if condition.
Weirdan wrote:Are you sure? I've been able to reproduce 'Unsupported operand types' with arrays and objects only; it works perfectly with strings and numbers...
you can var_dump($variable) to see it's real type before if condition.
I converted $z as well using intval() and now the script works fine! Thanks a lot!