PHP code is not recognizing HTML

-1

I wrote an HTML code inside a for structure, but it is not identifying, it follows the code:

<form method="get" action="_modelophp.php">
    <h1>tabuada</h1>
    <select name="num">
        <?php
            for{$inicio=1;$inicio<=10;$inicio++}{
                echo "<option>$inicio</option>";
            }
        ?>
    </select>
    
asked by anonymous 23.03.2018 / 20:17

1 answer

1

Your for is poorly structured.

You are using { } braces in parentheses ( ) .

for{$inicio=1;$inicio<=10;$inicio++}{
    echo "<option>$inicio</option>";
}

In other words, this should be the code

for($inicio=1;$inicio<=10;$inicio++){
    echo "<option>$inicio</option>";
}
    
23.03.2018 / 22:01