samedi 3 février 2018

PHP strpos generate per Session an new $findme possible?

Its possible to generate an random digit from requested word and use it with php strpos in Laravel?

Controller:

$mystring = 'abc';
$findme   = 'a';
$pos = strpos($mystring, $findme);

// Note our use of ===.  Simply == would not work as expected
// because the position of 'a' was the 0th (first) character.
if ($pos === false) {
    echo "The string '$findme' was not found in the string '$mystring'";
} else {
    echo "The string '$findme' was found in the string '$mystring'";
    echo " and exists at position $pos";
}

Example:

$mystring = '';

= the Username peterfoxisgood

Now i want for every new User session, example for login page, an new $findme = 'a'; word from the Username.

all Characters from word p e te r f o x i s g o o d can be used for generate.

Per session an new $findme = 'a'; word now like f after next login g.

Possible?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire