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..

Did you know?Explore Trending and Topic pages for more stories like this.
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

user data not transferring to new page
I'm a PHP learner. After an index.php page, the user goes to a login.php page. Both pages seem to

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

Data storage spaces in varchar2
Trying to understand what's happening.
I am selecting a value from a table that is defined as c

selectbox+database connection retrive problem
Code: [Select]
<tr>
<th align="left" scope="c

Unidentified index error in a simple form
I have been trying to make an HTML form that is handled by a PHP script. So far my attempts to get i

Auto fill in input value based on User_ID
Hello,

I'm looking form some input on the following problem.

User loads page ->

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

TabControl Inside ListView Not Editing
Hello everybodyI have a ListView on my page. Inside the ListView I put a TabControl, cuz I want to p

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