I think i'm using the syntax incorrectly


Posted on 16th Feb 2014 07:03 pm by admin

Hi Everyone!

I'm new to this forum and a newbie with PHP - I'm glad I found this site - I hope to learn a lot! For my first and hopefully one of few questions, lol..

I told my boss i'd help him out with making a script to sort a txt file he has with 92 pages of e-mail addresses into something organized. Before i work out how to check for duplicates, so on and so forth - I'm trying to do the basics. I realise this is wrong

Code: <?php
$emails=fopen('test.txt','r');
$newlist=fopen('test2.txt','a');
while(! feof($emails))
{
$newline=fgets($emails);

$newchar=fgetc($newline);


if ($newchar==" ")
fseek($newlist,0,seek_end);
else

{
$addy = fnmatch ("*@*.*",$newline);

fwrite($newlist,$addy);
}
}
?>


I'm just trying to get the script to store a line in the variable and then go by character until it hits a space and move down to the next line to write the next e-mail it finds - I think the sequence im searching for is also a bit off. I understand I will need a loop of some sort so all the char's in the $newline character are viewed, can someone please help me out - I feel i'm so close to doing this!

No comments posted yet

Your Answer:

Login to answer
337 Like 22 Dislike
Previous forums Next forums
Other forums

Bluetooth RSSI & VIsta
Okie I got 4 Bluetooth adapters, a DBT-120 by Dlink, A Zonet Microsoft Bluetooth which is what I use

Adding Different Numbers From MySQL
Basically I have a mysql database with a couple prices as the following:

9.99
9.99
9.99

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

Delete all files in folder except with certain name
I have a script that I want to delete all files in a folder (taken from a database) except for one n

How to add advertisment on top of videos
Hello,
I was told that i should find the answer for this problem in this forums.
I searched a

uploading video files into mysql in php
hi,
I have the video files which i have to upload into mysql db. along with creating thumbnails f

Change image filetype on upload?
Hi,
I've got a form which uploads an image to the server.
Is it possible to change the image t

highlighting search terms
well, I started this in the regular PHP section, but it no longer fits there. Suffice it to say, I'm

how to get sn motherboard
Hello.
I want to get serial number motherboard, cpu and else hardware.
Can You show me sam

adding 0 to numbers
Hey guys i need to create a 00001 number in a loop. Is there a better way of forcing a 5 digit numbe

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash