isset function for dumb

Saturday, May 15, 2010 |

this another example



$title = "voip phones";
$check = (isset($_GET['view']) ? true : false) ;
if($check){
echo "this page talk about voip";
}


last exampel is wrong because isset function already return bool (true | false)

this is true exampel

$title = "voip phones";
$check = isset($_GET['view']) ; // just check var by isset function
if($check){
echo "this page talk about voip";
}

0 التعليقات: