Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/ovningar/

index.php
ovn-extra1.php
ovn-extra2.php
ovn-extra3.php
ovn-gr1.php
ovn-gr6.php
ovn-gr7.php

ovn-gr6.php

32 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html lang="sv">
<head>
    <meta charset="UTF-8">
    <title>kjskjs</title>
</head>

<body>
    <?php
    $array1
=[];
    
$tal1=2;
    
$delare= 0;
    for(
$tal1=2; $tal1<=100; $tal1++){
        for (
$i = 2; $i <= floor($tal1**(1/2)); $i++){
            if (
$tal1 % $i == 0){
                
$delare++;
            }
        }
        if (
$delare == 0){
            
$array1[]= $tal1;
        }
        
$delare=0;

    }
    foreach (
$array1 as $blimp){
    echo 
"$blimp <br>"; 
    }
    
$antal = count($array1);
    echo 
"$antal Stycken";
    
?>
</body>
</html>