RE: [PHP] Re: Does anybody have code for this?

2002-03-01 Thread Demitrious S. Kelly

function scramble($string) {
$count2++;
while ( $count2 != strlen($string) ) {
$bad=1;
while ( $bad == 1 ) {
$rand=rand(0, (strlen($string) - 1));
if ( $used[$rand] != 1 ) {
$bad=0;
$used[$rand]=1;
}
}
$newstring.=substr($string, $rand, 1);
$count2++;
}
return($newstring);
}

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 28, 2002 11:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Does anybody have code for this?

on 3/1/02 2:43 AM, Monty at [EMAIL PROTECTED] wrote:

 Maybe try looking into the crypt() or md5() functions on php.net.
These will
 encrypt a string more than scramble, but maybe one of these serves
the
 purpose.
No, that isn't what I'm looking for.  It's not for encryption.  I just
need
a function that scrambles a string.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Does anybody have code for this?

2002-02-28 Thread Monty

Maybe try looking into the crypt() or md5() functions on php.net. These will
encrypt a string more than scramble, but maybe one of these serves the
purpose.


 From: [EMAIL PROTECTED] (Leif K-Brooks)
 Newsgroups: php.general
 Date: Fri, 01 Mar 2002 02:30:04 -0500
 To: [EMAIL PROTECTED]
 Subject: Does anybody have code for this?
 
 I'm looking for two functions.  One to scramble a string, and one to check
 if one string is a scrambled version of another.  Does anybody have these?
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Does anybody have code for this?

2002-02-28 Thread Leif K-Brooks

on 3/1/02 2:43 AM, Monty at [EMAIL PROTECTED] wrote:

 Maybe try looking into the crypt() or md5() functions on php.net. These will
 encrypt a string more than scramble, but maybe one of these serves the
 purpose.
No, that isn't what I'm looking for.  It's not for encryption.  I just need
a function that scrambles a string.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Does anybody have code for this?

2002-02-28 Thread Monty

Explain what you mean by scramble and what you are trying to accomplish?
There isn't a built-in function for this that I've seen, so, you'll have to
write your own function using various PHP commands. This function might be
useful to that end: http://www.php.net/manual/en/function.levenshtein.php


 From: [EMAIL PROTECTED] (Leif K-Brooks)
 Newsgroups: php.general
 Date: Fri, 01 Mar 2002 02:50:09 -0500
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: Does anybody have code for this?
 
 on 3/1/02 2:43 AM, Monty at [EMAIL PROTECTED] wrote:
 
 Maybe try looking into the crypt() or md5() functions on php.net. These will
 encrypt a string more than scramble, but maybe one of these serves the
 purpose.
 No, that isn't what I'm looking for.  It's not for encryption.  I just need
 a function that scrambles a string.
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php