dc_jt Posted November 24, 2006 Share Posted November 24, 2006 Im just looking through some code trying to learn few things.I came across this line:[quote]$iStart = ($_GET['page']) ? (((int)$_GET['page']-1) * 5) : 0; [/quote]I want to comment it so I know what it does, so far ive got://Set $iStart to page if the page is an integer....??Thanks Quote Link to comment Share on other sites More sharing options...
mansuang Posted November 24, 2006 Share Posted November 24, 2006 [quote author=dc_jt link=topic=116152.msg473082#msg473082 date=1164377033]$iStart = ($_GET['page']) ? (((int)$_GET['page']-1) * 5) : 0; [/quote]It's the short tag of 'if' statement.same as:[code]if($_GET['page']){ $iStart = ((int)$_GET['page']-1)*5;}else{ $iStart = 0;}[/code] Quote Link to comment Share on other sites More sharing options...
dc_jt Posted November 24, 2006 Author Share Posted November 24, 2006 Thanks :) Quote Link to comment Share on other sites More sharing options...
mansuang Posted November 24, 2006 Share Posted November 24, 2006 No problem ;D Quote Link to comment 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.