Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php random number

<?php
// src/Controller/LuckyController.php
namespace AppController;

use SymfonyComponentHttpFoundationResponse;

class LuckyController
{
    public function number(): Response
    {
        $number = random_int(0, 100);

        return new Response(
            '<html><body>Lucky number: '.$number.'</body></html>'
        );
    }
}
Source by symfony.com #
 
PREVIOUS NEXT
Tagged: #php #random #number
ADD COMMENT
Topic
Name
2+5 =