I'm teaching myself PHP through a book and to make this easier I made myself a function to save myself having to write echo "<br/>";
a million times. My function works fine but after accidentally leaving out a parameter and getting an error I tried to make it so that if I left the function empty it would simply add one <br/>
but I can't seem to get it to work.
Here is my code after my last attempt (which was to try case NULL: echo "<br/>";
):
function br($break){
switch ($break){
case 1:
echo "<br/>";
break;
case 2:
echo "<br/><br/>";
break;
case 3:
echo "<br/><br/><br/>";
break;
case 4:
echo "<br/><br/><br/><br/>";
break;
case 5:
echo "<br/><br/><br/><br/><br/>";
break;
case NULL:
echo "<br/>";
}
}
Any ideas? Thanks guys!
P.s. Sorry if this is a really silly question, I only started learning PHP on Monday and my programming experience is somewhat limited :)