Select what you want to copy and in doing so you will keep the formatting when pasting it.
That code above does the following (line by line):
1. adds the string of email address... could also add this as an array, or even another chain object!
2. explode the string into an array based on the , character
3. trim leading and trailing whitespace from each element in the array
4. convert all the email addresses to lowercase
5. According to the regex, remove all characters that do not fit into the regex
6. make sure there are no duplicate email addresses in the array
7. now join up the array and glue the elements back together by adding a ; between each one
8. new escape the email address so they are safe to be inserted into a database.
the printed result is: "scott@site.com;me@site.com;vbassassin@site.com"
->append('random characters to increase
security')
->append('seed such as their
username')
->md5();
Select what you want to copy and in doing so you will keep the formatting when pasting it.
Line by line:
1. add the users posted password
2. append some random characters to the password to make the hash stronger
3. append a unique seed such as the users username to the password to make the hash stronger still
4. md5 the string
Select what you want to copy and in doing so you will keep the formatting when pasting it.
This will do the following:
1. Load the usernames.txt file
2. split up the usernames into an array, splitting each one by the line break
3. trim all whitespace from each name
4. remove duplicate names
5. escape the usernames so can be shown safely in the browser (prevents html, js, etc from being executed)
If you add ->save() to the end, it will overwrite the file, if you add ->('newfile.txt') it will save a copy of the new data in the newfile.txt file.
By the way, the class implements both the iteration interface (so the object can be used in foreach loops etc) and it implements the arrayaccess interface allowing direct access like an array eg: $a['key'] and unset($a[0]) etc. Also, you can extend the class to add your own unique chaining methods Oh and the magic method __toString() is used to transparently convert the object to a string when required such as print $string;
Anyway, i'm going to run this as an open source project in a few weeks time... the website i will put up for it will be on my companies new web development platform (a website that creates websites). I will also dual license it under the GNU license and the MIT license.
You do not have permission to post replies to topics in this board. If you want to join in with discussions and create new topics please register. If you want to register your own free account with us, please click here.