Tuesday, January 25, 2011

Re: How to make random user names out of list of a list of names in a text file, I can not complete my php script

foreach ($lines as $line)

$lines is not even defined? omg!?

php has nothing to do with magic (although some say it is automagic^^)


On 25 Jan., 13:21, andy_the ultimate baker
<anandghaywankar...@gmail.com> wrote:
> hi,
> first thing is u r very much confusing about ur sayings. do seprate
> the things u want to do, rather to to solve entire problem at a time,
> u need to devide it and then go step by step.
>
> second thing in ur code u have forgot to close curly braes. take a
> look of it.
>
> now post the ur issue once again in clear way.
> actually i can help u becouse few mnt before i was working on same.
>
> On Jan 25, 2:02 pm, Tony <vpv...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi;
> > I am not expert in php and trying to make a php script for making
> > random user names from a list of first names in a text file and write
> > it to a new text file, I got some simple php code but I am not sure
> > how to proceed,
>
> > I am very grateful if anyone can help here.,
>
> > I have a list of first names in a text file, one name per line, the
> > list has been copied from a excel column,
> > now I want the script to read the text file and then add random number
> > and characters ( max of 5) after the name separated by a underscore or
> > hyphen then print the new made user names into a new text file
> > organized the same way the first name file is, one user name per line.
>
> > e.g of first name text file:
> > SAM
> > David
> > bob
> > and then the example of new user names becomes similarly like this:
> > SAM_6yt66
> > David_23rt
> > bob-44uyt
> > here is what I could get so far:
>
> > <?php
> > $textfile = "name.txt";
> > $file = fopen("$textfile", 'r');
> > $Data = fread($file, filesize($textfile));
> > foreach ($lines as $line) {
> > $line = rtrim($line);
>
> > ?>

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: