General Community > Scripting Help

Regex Help Please

(1/1)

Shoeb Omar:
How do you do this:

$password =~ tr/0123456789/ymifxupbck/;

in php?

[Unknown]:
For that specific case, I would use:

$password = strtr($password, '0123456789', 'ymifxupbck');

(no longer a regular expression, and thence lightning fast.)

-[Unknown]

Shoeb Omar:
sweet :D

works like a charm :).

(was converting over the random password generator in yabb for a script I'm doing for a client heh ;))

Navigation

[0] Message Index

Go to full version