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

square instead of number
Hello
I do not know why but this code seems to work fine only in my xampp local insallation but n

At max how many columns is advisable to create in a table/view
Hi All,
I have two transaction table from which i want to create a simple view or material

Something Non-Traditional. Can we solve?
I have an idea for an application here. It's mostly flash, but it couldn't work without a somewhat n

how can i make a .gif images for my site
Dear Friends ,

Pls solve my problem , I am starting making new site but i dont know how can i

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

email form (cannot find the problem)
Hello there. I've been having trouble with an email form. Can't find the problem really. I've tested

Array question
Does anyone know how to create a program that takes the $ amount for 8 different departments and gi

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

Matchcode in ALV change header column
Hello everyone,

I am working in an SAP system that is currently in upgrade and conversion

problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mi

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