Q:

PHP Logic - Don't know where else to ask

I'm sure this isn't the right place to ask this.. 
Is there a better way to write this so it increments by itself indefinitely?   
if ($page == '1') $pagv = $x;
    if ($page == '2') $pagv = $x + 4; 
    if ($page == '3') $pagv = $x + 8;
    if ($page == '4') $pagv = $x + 12;
    if ($page == '5') $pagv = $x + 16;   
    if ($page == '6') $pagv = $x + 20;

And is there a proper place to ask such questions?

A:

You can do simply -
$pagv = $x + (($page -1) * 4); // if the factor is always 4

Or if the factor is not fixed then use a variable for it and use it accordingly.
$factor = 4;
$pagv = $x + (($page -1) * $factor);

