You already know about conditional statements such as if.  You have also used loops such as while in PHP.  Here is more on that sort of thing.