![]() |
String help!
Well i have been trying to extract each chars of a string and keep them in an array. I have used loop to get it but failed. any ideas...
e.g. Code:
$string = 'hello'; |
You would want to do something like this:
PHP Code:
PHP Code:
|
BTW... welcome to the forums!
You should go introduce yourself over in the new member area. |
You can think about this two ways.
First, you can access the string as if it were an array (which you're attempting to do), e.g. PHP Code:
PHP Code:
|
In php5 you can say:
PHP Code:
|
Strings are arrays by default.. you can access each letter directly as SOCK showed.
|
Thanks for your help. Actually i was trying to make script which would be used for authentication. I thought i would count the length of the password and get each char from password and hash them differently and merge them at end before sending it to the db for authenticaion.
|
That'll be quite a waste of good resources. Encoding a password which has about 15 letters, would take a lot longer. Than you'll do something like;
PHP Code:
Quote:
|
Actually i was trying to do the same way but later figured out that this would take longer time if password is long. Well i have been mixing password with salt and hashing with md5 and sha couple of time and reversing the hash or changing the pos of 16 chars of first and last chars of MD5 then only checking with the DB.
|
Quote:
|
| All times are GMT. The time now is 01:28 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0