bilis_money Posted June 18, 2006 Share Posted June 18, 2006 ok, i have had visited sitepoint.comand along the way i got this code;[code] // If we want more fields, then use, preupload.php?number_of_fields=20 $number_of_fields = (isset($_GET['number_of_fields'])) ? (int)($_GET['number_of_fields']) : 5;[/code]ok, i know that the variable $number_of_fields was assigned by an isset which is from $_GETwhich has a ternary condition.now my basic question is what is an (int) doing inside a ternary condition operator?what an (int) purpose?thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/12294-what-is-this-int-do-inside-ternary-operator/ Share on other sites More sharing options...
poirot Posted June 18, 2006 Share Posted June 18, 2006 Type casting.[a href=\"http://www.php.net/language.types.type-juggling#language.types.typecasting\" target=\"_blank\"]http://www.php.net/language.types.type-jug...pes.typecasting[/a] Quote Link to comment https://forums.phpfreaks.com/topic/12294-what-is-this-int-do-inside-ternary-operator/#findComment-46975 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.