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

Quick fix: Conditional statement with an array
Hi, I'm getting the temperature value off of the Environment Canada website along with the icon file

gather checkbox data from form into email
Hello all,

First, i'd like to thank everyone who responded to my previous posts regarding set

a very simple php header question (sorry!)
Firstly...I do apologise if this annoys anyone....a header error

I'm do not know php &

Consuming MII WebService in Java WebDynpro
Hello,

We are facing a strange situation...

We define a transaction in MII to

Selecting an "empty" date formated field
How do you select an "empty" date field? I've tried the few ways I can think.
SQL> select

Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

IIS on 2003 anon access disabled issue
I have an IIS server that belongs to a domain, and anonymous access is turned off for all my sites.

Need PHP help... have all the elements... just need help putting them together :
Hey Guys,

I was wondering if someone could help me. I am doing a website for a client which

mysql select query problem
how can i select multiple fields from multiple table in one query like

i have table name t1 a

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