Re: [PHP]Cannot output the same data from text file in PHP

2009-05-15 Thread tedd

At 4:45 PM -0400 5/14/09, Andrew Ballard wrote:
On Thu, May 14, 2009 at 4:33 PM, Paul M Foster 
pa...@quillandmouse.com wrote:

  My stance is, if you're going to subscribe to an email list, learn how

 to unsubscribe, how to see if you've been inadvertantly unsubscribed,

  learn email netiquette on lists, etc.

I agree with you for the most part. I'm just saying that the presence
of unsubscribe information in the message headers themselves is of
very little value to most people.



Andrew:

I'm sure you don't disagrees, but I side with Paul with this 
clarification: People who subscribe to this list do not fall in to 
the most people category. (proof -- think of Rob) :-)


One must have some idea of what this list is about before subscribing 
to it. It's a deliberate act wherein the person has to travel from 
nonsubscriber to subscriber where along the way they are presented 
with information for them to read and agree as to what you are doing 
AND how to undo it.


If they choose to ignore/forget that information then I claim that 
does not excuse them from the responsibilities they agreed to at the 
time of their subscription.


Far too often in this current world of political correctness we 
must feel for the people who have made bad choices -- but I say 
screw 'em -- they should know better!  :-)


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-15 Thread Andrew Ballard
On Fri, May 15, 2009 at 10:24 AM, tedd tedd.sperl...@gmail.com wrote:
 At 4:45 PM -0400 5/14/09, Andrew Ballard wrote:

 On Thu, May 14, 2009 at 4:33 PM, Paul M Foster pa...@quillandmouse.com
 wrote:
   My stance is, if you're going to subscribe to an email list, learn how

  to unsubscribe, how to see if you've been inadvertantly unsubscribed,

   learn email netiquette on lists, etc.

 I agree with you for the most part. I'm just saying that the presence
 of unsubscribe information in the message headers themselves is of
 very little value to most people.


 Andrew:

 I'm sure you don't disagrees, but I side with Paul with this clarification:
 People who subscribe to this list do not fall in to the most people
 category. (proof -- think of Rob) :-)

I agree, but I've subscribed and unsubscribed to a number of lists
over the years, and I never knew anything about the unsubscribe
headers for mailing list messages until someone mentioned them on this
list. As such, I would never have looked there for information on how
to unsubscribe.

 One must have some idea of what this list is about before subscribing to it.
 It's a deliberate act wherein the person has to travel from nonsubscriber to
 subscriber where along the way they are presented with information for them
 to read and agree as to what you are doing AND how to undo it.

One would think. ;-)

I know that at least part of the problem is that mailing lists vary so
much depending on the software they use and the options specified by
the list owners/managers.

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Peter Ford
Moses wrote:
 Hi Folks,
 
 I have a written a script in PHP which outputs the result from a text file.
 The PHP script is as follows:
 
 ?php
 $alldata = file(result.txt);
 echo tabletrtd;
 foreach($alldata as $line_num = $line) {
 echo $line.br;
 }
 echo/td/tr/table;
 ?
 
 I have attached the result.txt file. However the output of the script is as
 follows:
 
 
 Query: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60
 
 Sbjct: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60
 
 which is not exactly  as in the result.txt file in that the pipelines
 are displaced.
 
 Any pointer to this problem shall be appreciated. Thanking you in advance.
 
 Moses
 

Not a PHP problem, but a HTML problem:
First, HTML compresses white space into just one space, so all of those leading
spaces on line 2 are lost.
Second, you are (probably) displaying using a proportionally-spaced font, so the
narrow pipeline characters take up less width than the letters.

So you need something like:
?php
$alldata = file(result.txt);
echo tabletrtd style='white-space: pre; font-family: monospace;';
foreach($alldata as $line_num = $line)
{
echo $line.\n;
}
echo/td/tr/table;
?


-- 
Peter Ford  phone: 01580 89
Developer   fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Jan G.B.
You could even make it shorter, if you don't need the line numbers anyway:
pre
 ?
  echo nl2br(file_get_contents('file.txt'));
 ?
/pre

2009/5/14 Peter Ford p...@justcroft.com:
 Moses wrote:
 Hi Folks,

 I have a written a script in PHP which outputs the result from a text file.
 The PHP script is as follows:

 ?php
 $alldata = file(result.txt);
 echo tabletrtd;
 foreach($alldata as $line_num = $line) {
 echo $line.br;
 }
 echo/td/tr/table;
 ?

 I have attached the result.txt file. However the output of the script is as
 follows:


 Query: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60
 
 Sbjct: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60

 which is not exactly  as in the result.txt file in that the pipelines
 are displaced.

 Any pointer to this problem shall be appreciated. Thanking you in advance.

 Moses


 Not a PHP problem, but a HTML problem:
 First, HTML compresses white space into just one space, so all of those 
 leading
 spaces on line 2 are lost.
 Second, you are (probably) displaying using a proportionally-spaced font, so 
 the
 narrow pipeline characters take up less width than the letters.

 So you need something like:
 ?php
 $alldata = file(result.txt);
 echo tabletrtd style='white-space: pre; font-family: monospace;';
 foreach($alldata as $line_num = $line)
 {
    echo $line.\n;
 }
 echo/td/tr/table;
 ?


 --
 Peter Ford                              phone: 01580 89
 Developer                               fax:   01580 893399
 Justcroft International Ltd., Staplehurst, Kent

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Mike Roberts
Is there a moderator or some responsible party who is in charge of this
list. Please delete my profile and stop sending messages. This is the
6th such request. 

 

 

 

 

 Sincerely,

 

 Michael Roberts

 Civil Engineering Executive Recruiter

 Corporate Staffing Services

 150 Monument Road, Suite 510

 Bala Cynwyd, PA 19004

 P 610-771-1084

 F 610-771-0390

 E mrobe...@jobscss.com mailto:mrobe...@jobscss.com 

 

From: Moses [mailto:jam...@gmail.com] 
Sent: Thursday, May 14, 2009 5:19 AM
To: php-general@lists.php.net
Subject: [PHP]Cannot output the same data from text file in PHP

 

Hi Folks,

I have a written a script in PHP which outputs the result from a text
file.
The PHP script is as follows: 

?php
$alldata = file(result.txt);
echo tabletrtd;
foreach($alldata as $line_num = $line) {
echo $line.br;
}
echo/td/tr/table;
?

I have attached the result.txt file. However the output of the script is
as
follows:


Query: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60

 
Sbjct: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60


which is not exactly  as in the result.txt file in that the pipelines
are displaced.

Any pointer to this problem shall be appreciated. Thanking you in
advance.

Moses



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Nathan Rixham

as far as i know you just send an email to:
php-general-unsubscr...@lists.php.net and then reply to the confirmation 
- its a standard mailing list which you subscribed to at some point, no 
profiles or such like.


Mike Roberts wrote:

Is there a moderator or some responsible party who is in charge of this
list. Please delete my profile and stop sending messages. This is the
6th such request. 

 

 

 

 


 Sincerely,

 


 Michael Roberts

 Civil Engineering Executive Recruiter

 Corporate Staffing Services

 150 Monument Road, Suite 510

 Bala Cynwyd, PA 19004

 P 610-771-1084

 F 610-771-0390

 E mrobe...@jobscss.com mailto:mrobe...@jobscss.com 

 

From: Moses [mailto:jam...@gmail.com] 
Sent: Thursday, May 14, 2009 5:19 AM

To: php-general@lists.php.net
Subject: [PHP]Cannot output the same data from text file in PHP

 


Hi Folks,

I have a written a script in PHP which outputs the result from a text
file.
The PHP script is as follows: 


?php
$alldata = file(result.txt);
echo tabletrtd;
foreach($alldata as $line_num = $line) {
echo $line.br;
}
echo/td/tr/table;
?

I have attached the result.txt file. However the output of the script is
as
follows:


Query: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60

 
Sbjct: 1 atggcaatcgtttcagcagattcgtaattcgagctcgcccatcgatcctcta 60



which is not exactly  as in the result.txt file in that the pipelines
are displaced.

Any pointer to this problem shall be appreciated. Thanking you in
advance.

Moses





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Ashley Sheridan
On Thu, 2009-05-14 at 09:29 -0400, Mike Roberts wrote:
 Is there a moderator or some responsible party who is in charge of this
 list. Please delete my profile and stop sending messages. This is the
 6th such request. 
 
As I and many others have said before, the  unsubscribe email address is
on EVERY header sent from the PHP list. Note, I mean headers and not
footers!


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Andrew Ballard
On Thu, May 14, 2009 at 3:29 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
 On Thu, 2009-05-14 at 09:29 -0400, Mike Roberts wrote:
 Is there a moderator or some responsible party who is in charge of this
 list. Please delete my profile and stop sending messages. This is the
 6th such request.

 As I and many others have said before, the  unsubscribe email address is
 on EVERY header sent from the PHP list. Note, I mean headers and not
 footers!


 Ash
 www.ashleysheridan.co.uk

Perhaps, but how many people actually (think to) look at e-mail
message headers, other than the basic To, Subject, and Date that are
usually plainly visible in mail clients? And it's not even like mail
clients read the headers and add an Unsubscribe link/button to the UI
when reading a message.  :-)

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Mike Roberts
Ok, I think we are almost there. First I was given 
php-general-unsubscr...@lists.php.net but that bounced back. Second, I
use MS outlook ( 03 or 07) which does not accurately display headers,
probably ( in my case at all) because it's audience is less savvy than
this audience, and too much information can be dangerous. Thirdly I want
to thank everybody for their attempts, and ask if somebody can copy and
past the address ( provided it is not the same as the one above that did
not work). 





 Sincerely,

 Michael Roberts
 Civil Engineering Executive Recruiter
 Corporate Staffing Services
 150 Monument Road, Suite 510
 Bala Cynwyd, PA 19004
 P 610-771-1084
 F 610-771-0390
 E mrobe...@jobscss.com


-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Sent: Thursday, May 14, 2009 3:50 PM
To: Andrew Ballard
Cc: Mike Roberts; Moses; php-general@lists.php.net
Subject: Re: [PHP]Cannot output the same data from text file in PHP

On Thu, 2009-05-14 at 15:30 -0400, Andrew Ballard wrote:
 On Thu, May 14, 2009 at 3:29 PM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
  On Thu, 2009-05-14 at 09:29 -0400, Mike Roberts wrote:
  Is there a moderator or some responsible party who is in charge of
this
  list. Please delete my profile and stop sending messages. This is
the
  6th such request.
 
  As I and many others have said before, the  unsubscribe email
address is
  on EVERY header sent from the PHP list. Note, I mean headers and not
  footers!
 
 
  Ash
  www.ashleysheridan.co.uk
 
 Perhaps, but how many people actually (think to) look at e-mail
 message headers, other than the basic To, Subject, and Date that are
 usually plainly visible in mail clients? And it's not even like mail
 clients read the headers and add an Unsubscribe link/button to the UI
 when reading a message.  :-)
 
 Andrew

No, but that would be a pretty neat idea!


Ash
www.ashleysheridan.co.uk


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Ashley Sheridan
On Thu, 2009-05-14 at 16:01 -0400, Mike Roberts wrote:
 Ok, I think we are almost there. First I was given 
 php-general-unsubscr...@lists.php.net but that bounced back. Second, I
 use MS outlook ( 03 or 07) which does not accurately display headers,
 probably ( in my case at all) because it's audience is less savvy than
 this audience, and too much information can be dangerous. Thirdly I want
 to thank everybody for their attempts, and ask if somebody can copy and
 past the address ( provided it is not the same as the one above that did
 not work). 
 
 
 
 
 
  Sincerely,
 
  Michael Roberts
  Civil Engineering Executive Recruiter
  Corporate Staffing Services
  150 Monument Road, Suite 510
  Bala Cynwyd, PA 19004
  P 610-771-1084
  F 610-771-0390
  E mrobe...@jobscss.com
 
 
 -Original Message-
 From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
 Sent: Thursday, May 14, 2009 3:50 PM
 To: Andrew Ballard
 Cc: Mike Roberts; Moses; php-general@lists.php.net
 Subject: Re: [PHP]Cannot output the same data from text file in PHP
 
 On Thu, 2009-05-14 at 15:30 -0400, Andrew Ballard wrote:
  On Thu, May 14, 2009 at 3:29 PM, Ashley Sheridan
  a...@ashleysheridan.co.uk wrote:
   On Thu, 2009-05-14 at 09:29 -0400, Mike Roberts wrote:
   Is there a moderator or some responsible party who is in charge of
 this
   list. Please delete my profile and stop sending messages. This is
 the
   6th such request.
  
   As I and many others have said before, the  unsubscribe email
 address is
   on EVERY header sent from the PHP list. Note, I mean headers and not
   footers!
  
  
   Ash
   www.ashleysheridan.co.uk
  
  Perhaps, but how many people actually (think to) look at e-mail
  message headers, other than the basic To, Subject, and Date that are
  usually plainly visible in mail clients? And it's not even like mail
  clients read the headers and add an Unsubscribe link/button to the UI
  when reading a message.  :-)
  
  Andrew
 
 No, but that would be a pretty neat idea!
 
 
 Ash
 www.ashleysheridan.co.uk
 
 
Aforementioned headers (at least the important ones!)

Mailing-List: contact php-general-h...@lists.php.net; run by ezmlm
Precedence: bulk
list-help: mailto:php-general-h...@lists.php.net
list-unsubscribe: mailto:php-general-unsubscr...@lists.php.net
list-post: mailto:php-general@lists.php.net
List-Id: php-general.lists.php.net

I believe for the unsubscribe the usual practice is  to send an empty
email with the subject line of 'UNSUBSCRIBE'. Empty means no signatures
too ;)


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Paul M Foster
On Thu, May 14, 2009 at 03:30:44PM -0400, Andrew Ballard wrote:

 On Thu, May 14, 2009 at 3:29 PM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
  On Thu, 2009-05-14 at 09:29 -0400, Mike Roberts wrote:
  Is there a moderator or some responsible party who is in charge of this
  list. Please delete my profile and stop sending messages. This is the
  6th such request.
 
  As I and many others have said before, the  unsubscribe email address is
  on EVERY header sent from the PHP list. Note, I mean headers and not
  footers!
 
 
  Ash
  www.ashleysheridan.co.uk
 
 Perhaps, but how many people actually (think to) look at e-mail
 message headers, other than the basic To, Subject, and Date that are
 usually plainly visible in mail clients? And it's not even like mail
 clients read the headers and add an Unsubscribe link/button to the UI
 when reading a message.  :-)

In most email clients, you can turn on full header display.

As a list admin on about six lists and a member of numerous lists, I
find it endlessly aggravating that people can't manage to unsubscribe
their own addresses to email lists. Our LUG has a lists page on its
website which clearly step-by-step indicates what must be done to
unsubscribe. Yet people never even look to see if there is such a page.
And then I've had people tell me they followed those instructions
exactly, and it didn't work. No, they didn't or it would have worked,
since people manage to follow those instructions successfully all the
time.

My stance is, if you're going to subscribe to an email list, learn how
to unsubscribe, how to see if you've been inadvertantly unsubscribed,
learn email netiquette on lists, etc.

It reminds me of people who call tech support saying their mouse doesn't
work. Then you find out they've picked it up and pointed it at the
screen to make the pointer move (true story).

If you're going to own a car, learn how to drive it. If you're going to
own a computer, learn how to operate it. If you're going to program,
read a book about it first (yes, you P.J.).

/rant

Paul

-- 
Paul M. Foster

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Andrew Ballard
On Thu, May 14, 2009 at 4:33 PM, Paul M Foster pa...@quillandmouse.com wrote:
 On Thu, May 14, 2009 at 03:30:44PM -0400, Andrew Ballard wrote:

 On Thu, May 14, 2009 at 3:29 PM, Ashley Sheridan
 a...@ashleysheridan.co.uk wrote:
  On Thu, 2009-05-14 at 09:29 -0400, Mike Roberts wrote:
  Is there a moderator or some responsible party who is in charge of this
  list. Please delete my profile and stop sending messages. This is the
  6th such request.
 
  As I and many others have said before, the  unsubscribe email address is
  on EVERY header sent from the PHP list. Note, I mean headers and not
  footers!
 
 
  Ash
  www.ashleysheridan.co.uk

 Perhaps, but how many people actually (think to) look at e-mail
 message headers, other than the basic To, Subject, and Date that are
 usually plainly visible in mail clients? And it's not even like mail
 clients read the headers and add an Unsubscribe link/button to the UI
 when reading a message.  :-)

 In most email clients, you can turn on full header display.

Yes, I know you CAN do that. I'm just saying that most people WON'T do
that for two reasons 1) it's an extra step and people are inherently
lazy and 2) it shows a lot more information that most people care to
see. Often the headers are longer than the message.

 As a list admin on about six lists and a member of numerous lists, I
 find it endlessly aggravating that people can't manage to unsubscribe
 their own addresses to email lists. Our LUG has a lists page on its
 website which clearly step-by-step indicates what must be done to
 unsubscribe. Yet people never even look to see if there is such a page.
 And then I've had people tell me they followed those instructions
 exactly, and it didn't work. No, they didn't or it would have worked,
 since people manage to follow those instructions successfully all the
 time.

 My stance is, if you're going to subscribe to an email list, learn how
 to unsubscribe, how to see if you've been inadvertantly unsubscribed,
 learn email netiquette on lists, etc.

 It reminds me of people who call tech support saying their mouse doesn't
 work. Then you find out they've picked it up and pointed it at the
 screen to make the pointer move (true story).

 If you're going to own a car, learn how to drive it. If you're going to
 own a computer, learn how to operate it. If you're going to program,
 read a book about it first (yes, you P.J.).

 /rant

 Paul

 --
 Paul M. Foster

I agree with you for the most part. I'm just saying that the presence
of unsubscribe information in the message headers themselves is of
very little value to most people.

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP]Cannot output the same data from text file in PHP

2009-05-14 Thread Ashley Sheridan
On Thu, 2009-05-14 at 16:33 -0400, Paul M Foster wrote:
 On Thu, May 14, 2009 at 03:30:44PM -0400, Andrew Ballard wrote:
 
  On Thu, May 14, 2009 at 3:29 PM, Ashley Sheridan
  a...@ashleysheridan.co.uk wrote:
   On Thu, 2009-05-14 at 09:29 -0400, Mike Roberts wrote:
   Is there a moderator or some responsible party who is in charge of this
   list. Please delete my profile and stop sending messages. This is the
   6th such request.
  
   As I and many others have said before, the  unsubscribe email address is
   on EVERY header sent from the PHP list. Note, I mean headers and not
   footers!
  
  
   Ash
   www.ashleysheridan.co.uk
  
  Perhaps, but how many people actually (think to) look at e-mail
  message headers, other than the basic To, Subject, and Date that are
  usually plainly visible in mail clients? And it's not even like mail
  clients read the headers and add an Unsubscribe link/button to the UI
  when reading a message.  :-)
 
 In most email clients, you can turn on full header display.
 
 As a list admin on about six lists and a member of numerous lists, I
 find it endlessly aggravating that people can't manage to unsubscribe
 their own addresses to email lists. Our LUG has a lists page on its
 website which clearly step-by-step indicates what must be done to
 unsubscribe. Yet people never even look to see if there is such a page.
 And then I've had people tell me they followed those instructions
 exactly, and it didn't work. No, they didn't or it would have worked,
 since people manage to follow those instructions successfully all the
 time.
 
 My stance is, if you're going to subscribe to an email list, learn how
 to unsubscribe, how to see if you've been inadvertantly unsubscribed,
 learn email netiquette on lists, etc.
 
 It reminds me of people who call tech support saying their mouse doesn't
 work. Then you find out they've picked it up and pointed it at the
 screen to make the pointer move (true story).
 
 If you're going to own a car, learn how to drive it. If you're going to
 own a computer, learn how to operate it. If you're going to program,
 read a book about it first (yes, you P.J.).
 
 /rant
 
 Paul
 
 -- 
 Paul M. Foster
 
So, erm, driving without learning and getting a license is wrong? :p


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php