PHP: How to create a function to generate string with defined max and min length?

36
January 12, 2019, at 12:20 PM

I want to create a self-defined string with defined length of the string. It appears the PHP itself isn't providing me the function I desire

so the function will go with like this:

generate_string("01", "001");

it will show me:

01

when I refresh the page, it'll show me:

001

so on and so forth

And when I loop it:


    for ($i = 0; $i <= 5; $i++) {
       echo generate_string("01", "001");
    }

It's gonna be:

01 001 001 01 01

How do I achieve this?

READ ALSO
Possible to disable specific deprecation warnings in Symfony 3.4?

Possible to disable specific deprecation warnings in Symfony 3.4?

I am working on migrating an existing Symfony 28 project to Symfony 3

49
Getting 4004 SQL Server error after execution of stored procedure with JSON input using PHP code

Getting 4004 SQL Server error after execution of stored procedure with JSON input using PHP code

We created a stored procedure in SQL server which takes input parameter as JSONProcedure is giving us results in JSON in the studio management

30
Integrate NTLM Authentication on ubuntu18.04 apache2.4

Integrate NTLM Authentication on ubuntu18.04 apache2.4

what are the things needs to be done to integrate Apache2::AuthenNTLM in apache2 on ubuntu 1804 with php7

47
htaccess query string wildcard rewrite

htaccess query string wildcard rewrite

I've tried some suggestions from other posts on similar subject but were not able to solve this exact issue

22