News:

Join the Facebook Fan Page.

Main Menu

Regex Help Please

Started by Shoeb Omar, October 30, 2003, 06:57:35 PM

Previous topic - Next topic

Shoeb Omar

How do you do this:

$password =~ tr/0123456789/ymifxupbck/;

in php?

[Unknown]

#1
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 ;))

Advertisement: