I think there a easier way to perform the same function but without if statements.
if (isset($_GET['limit']))
{
$limit = $_GET['limit'];
}
else
{
$limit = 10;
}
I think there a easier way to perform the same function but without if statements.
if (isset($_GET['limit']))
{
$limit = $_GET['limit'];
}
else
{
$limit = 10;
}
If there is I'd be open to hearing it...
...But I think your best bet is just a short hand if/else statement instead. Not that it really makes any difference.
$limit = (isset($_GET['limit']) ? $_GET['limit'] : 10;
More info here - http://www.lizjamieson.co.uk/9/short-if-statement-in-php/