生成1到100万之间的语法错误[关闭]

This code

<? php
$randdnumber = rand(1, 1000000);
echo "you won ".$randnumber."points";
?>

gives me error

syntax error, unexpected '$randdnumber' (T_VARIABLE) in index.php

also how to add output of two function together something like ..

 You won [$randdnumber] also you won [$randdnumber2]

is it possible ?

The exact problem is your php open tag is having space and also variable name you assigned and echoed are different :

Please remove it and change it to

<?php
    $randdnumber = rand(1, 1000000);
     echo "you won ".$randdnumber."points";
?>

FIXED CODE

    <?php
      $randdnumber = rand(1, 1000000);
      echo "you won ".$randdnumber."points";
    ?>

fix php tags and changed variable name

FIXED

    <?php
    $randnumber = rand(1, 1000000);
    echo "you won ".$randnumber."points";
    ?>