Quiz form with random questions
Theres nothing particularly unefficient about what you have, but there are a couple of things. instead of storing the variables like

$daysweek=$_POST['daysweek'];


just leave them in $_POST like 

if($_POST['daysweek']==7){//..


and then instead of 

echo "1. you got the right answer: $daysweek&lt;br/&gt;";


you already know the answer is 7 so just

echo "1. you got the right answer: 7&lt;br/&gt;";


but based on the content of your application you are not yet in a place where you need to be worrying about optimization